Searchable resource index
Bring status tabs, search, sortable columns, row quick actions, pagination, and empty states into one responsive table.
Installation
Free, no account required. Writes app/components/resource-index.tsx and adds @shopify/polaris-types@2.0.0. Registry item
API reference
heading / headerActionsstring / ReactNodeName the collection and optionally add primary or secondary header actions in the section.Optionaltabs / activeTab / onTabChangereadonly ResourceIndexTab[] / string / (tabId: string) => voidRender quick status or segment tabs with optional item counts above the search bar.Optionalsort / onSortChangeResourceIndexSort / (sort: ResourceIndexSort) => voidControl the active sorted column ID and direction across sortable column headers and the Sort menu.OptionalgetRowClickDelegate / rowActions(record: RecordType) => string | undefined / (record: RecordType) => readonly ResourceIndexRowAction[]Delegate full-row clicks to a primary link inside each row and add per-row navigation or callback actions in an overflow menu.OptionalgetRowLabel(record: RecordType) => stringProvide an accessible label describing each row for its trailing action menu.OptionalemptyHeading / emptyContent / emptyActionstring / ReactNode / { label: string; onAction: () => void }Configure the first-use empty state heading, message, and primary call to action.OptionalemptyFilterRecovery{ label: string; onClear: () => void }Supply a custom action to reset active tab or external filters when no records match.Optionaltoolbar / footerReactNodePlace selection controls inside the table filters bar and custom content below the table.OptionalpaginationResourceIndexPaginationEnable native table pagination with hasPrevious, hasNext, onPrevious, onNext, and an optional page label.OptionaltotalCount / sourceCountnumber / numberAnnounce the full matching count when records contains one page, and pass 0 for sourceCount in first-use empty states.records.lengthrecordsRequiredreadonly RecordType[]Pass the rows for the active page matching the current search.- Required
getRecordIdRequired(record: RecordType) => stringReturn a stable, unique ID for each row.- Required
columnsRequiredreadonly [ResourceIndexColumn<RecordType>, ...ResourceIndexColumn<RecordType>[]]Supply columns with ID, heading, renderer, optional sortable/sortLabels, listSlot for mobile cards, and format alignment.- Required
query / onQueryChangeRequiredstring / (query: string) => voidControl the search value in your host route.- Required
searchLabelstringGive the search field a resource-specific accessible name."Search records"loadingbooleanAnnounces that the host is fetching records. Otherwise announces the result count, empty list, or search with no matches.false
Run under Shopify App Home AppProvider. Point polarisUrl to the Polaris 2.0 runtime.