Elements Pro launch: $79 for the first 50 with LAUNCH50 · $129 standard.

Components / Blocks / FilterableDataTable

FilterableDataTable.

FreeBlock

A typed table workflow with local search, a semantic filter, loading, empty, and error states.

Demo dataResponsive

3 of 3 records

NameOwnerStatusUpdated
Project ApolloSarah ChenactiveMay 12
Project ZephyrJames ParkNeeds reviewMay 11
Project OrionMaya PatelarchivedMay 10

Installation

pnpm dlx shadcn@latest add https://elements.micropreneur.dev/r/filterable-data-table.json

The shadcn CLI writes the source into your project. Files added:

  • components/blocks/filterable-data-table.tsxblock
  • components/ui/button.tsxui
  • components/ui/input.tsxui
  • components/ui/native-select.tsxui
  • components/ui/skeleton.tsxui
  • components/ui/table.tsxui
  • components/elements/empty-state.tsxcomponent
  • lib/utils.tslib
Dependencies@base-ui/reactclass-variance-authorityclsxlucide-reacttailwind-merge

API

PropTypeDefaultDescription
columns (required)readonly FilterableDataTableColumn<T>[]—
emptyDescriptionReactNode'Try a different search or clear the active filters.'
emptyTitleReactNode'No matching records'
errorReactNode—
filterLabelstring'Status'
filterOptionsreadonly FilterableDataTableOption[][]
getFilterValue(row: T) => string—
getRowId (required)(row: T, index: number) => string—
getSearchText (required)(row: T) => string—
isLoadingbooleanfalse
rows (required)readonly T[]—
searchPlaceholderstring'Search records'

FilterableDataTableColumn

PropTypeDefaultDescription
align'left' | 'right'—
header (required)ReactNode—
id (required)string—
render (required)(row: T) => ReactNode—

FilterableDataTableOption

PropTypeDefaultDescription
label (required)string—
value (required)string—

Accessibility

  • Search and filter inputs have screen-reader labels.
  • The result count is announced politely as filters change.
  • The clear-filters button is disabled until a filter is active.