[polaris.shopify.com] Feedback (on /components/selection-and-input/index-filters?example=index-filters-with-no-search-or-filters)
Opened this issue · 0 comments
The IndexFilters
documentation seems a bit inconsistent. Specifically, IndexFilters
requires a tabs
prop, but this prop is not listed in the table of props below the sample code. Also, the sample code shows the tabs
prop, as it seems to be from an older version of Polaris due to the use of LegacyCard
.
I even looked though the TS definitions for IndexFilters
and it does not reference a tabs
prop either. However, in the declaration statement:
export declare function IndexFilters({ tabs, selected, onSelect, onSort, onSortKeyChange, onSortDirectionChange, onAddFilterClick, sortOptions, sortSelected, queryValue, queryPlaceholder, primaryAction, cancelAction, filters, appliedFilters, onClearAll, onQueryChange, onQueryFocus, onQueryClear, onEditStart, disabled, disableQueryField, hideFilters, loading, mode, setMode, disclosureZIndexOverride, disableStickyMode, isFlushWhenSticky, canCreateNewView, onCreateNewView, filteringAccessibilityLabel, filteringAccessibilityTooltip, hideQueryField, closeOnChildOverlayClick, disableKeyboardShortcuts, showEditColumnsButton, autoFocusSearchField, }: IndexFiltersProps): React.JSX.Element;
it does list the tabs
prop, but there's no indication that it is required.
As an aside, I have found similar discrepancies with other Polaris documentation pages. For example, on IndexTable
, the sample code code shows some older components, and even references a custom hook useIndexResourceState
, which is not documented. I later learned from support that this hook should not be used as it is for internal purposes only, hence being undocumented.
I realize the pages are auto-generated, so please ensure what is generated is current and accurate, especially for us relatively new developers without a ton of experience using the Polaris components.