Saved views and filter controls
Save pinned views, filter chips, multi-select/range filters, sort order, and visible columns with SavedViewControls.
Installation
Writes app/components/filter-controls.tsx and adds @shopify/polaris-types@2.0.0 once authenticated.
API reference
filtersRequiredreadonly FilterDescriptor[]Configure select dropdowns, multi-select checklists, and numeric min/max range filters. Active filters surface as removable chips.- Required
sorts / columnsRequiredFilterControlsProps['options'] / readonly { id: string; label: string }[]Provide sort options and toggleable columns placed in a Columns popover.- Required
defaultVisibleColumnsreadonly string[]Enable a Reset to defaults action inside the Columns popover when visible columns differ.Optionalsettings / onSettingsChangeRequiredViewSettings / (settings: ViewSettings) => voidControl search query, active filters, sort order, and visible columns.- Required
views / activeViewIdRequiredreadonly SavedView[] / string | nullLoad merchant-scoped views with optional pinned flags; pinned views stay first beside Default.- Required
onSelectViewRequired(id: string | null) => voidSwitch between the default view tab and saved view tabs.- Required
defaultViewLabelstringLabel for the first tab representing the default view."Default"onCreateViewRequired(name: string, settings: ViewSettings) => void | Promise<void>Persist a newly saved view with its active query, filters, columns, and sort order.- Required
onUpdateView(id: string, settings: ViewSettings) => void | Promise<void>Enable saving unsaved changes to an existing view and persist its query, filters, columns, and sort order.OptionalonDuplicateView(view: SavedView) => void | Promise<void>Duplicate the active saved view from the view actions menu.OptionalonTogglePinView(id: string) => void | Promise<void>Pin or unpin the active saved view so pinned views stay grouped first.OptionalonRenameView / onDeleteViewRequired(id: string, name: string) => void | Promise<void> / (id: string) => void | Promise<void>Persist the new name or delete the view from the active view menu.- Required
showSearch / searchLabel / disabledboolean / string / booleanOptionally include a search bar inside SavedViewControls and disable controls during async loads.false
Run under Shopify App Home AppProvider. Point polarisUrl to the Polaris 2.0 runtime.
Place SavedViewControls inside an s-table filters slot for an IndexFilters-style toolbar with search, view tabs, multi-select & range filters popover, removable filter chips, and a Columns popover, or use FilterControls by itself for one dropdown.