Unified UI

Data Table Toolbar

A composable toolbar with search, faceted filters, column visibility toggle, and view mode switcher for DataTable.

Basic

A composable toolbar with search, faceted filters, column visibility toggle, and view mode switcher for DataTable.

Installation

Install the component via the CLI in one command.

npx @work-rjkashyap/unified-ui add data-table-toolbar
pnpm dlx @work-rjkashyap/unified-ui add data-table-toolbar
npx @work-rjkashyap/unified-ui add data-table-toolbar
bunx @work-rjkashyap/unified-ui add data-table-toolbar

If you haven't initialized your project yet, run npx @work-rjkashyap/unified-ui init first. See the CLI docs for details.

Or install the full package

Use this approach if you prefer to install the entire design system as a dependency instead of copying individual components.

npm install @work-rjkashyap/unified-ui
pnpm add @work-rjkashyap/unified-ui
yarn add @work-rjkashyap/unified-ui
bun add @work-rjkashyap/unified-ui

Anatomy

import { DataTableToolbar } from "@work-rjkashyap/unified-ui";

Examples

Search Only

With Faceted Filters

Column Visibility

View Mode Switcher


Props

PropTypeDefaultDescription
searchValuestring""Current search value.
onSearchChange(value: string) => voidSearch change callback.
searchPlaceholderstring"Search..."Placeholder text.
searchDebouncenumber300Debounce delay in ms.
filtersDataTableFilter[]Filter definitions.
onFilterChange(id: string, selected: string[]) => voidFilter change callback.
onClearFilters() => voidClear all filters callback.
columnsColumnVisibility[]Column visibility state.
onColumnVisibilityChange(id: string, visible: boolean) => voidColumn visibility change callback.
viewMode"table" | "grid" | "list"Current view mode.
viewModesViewMode[]Available view modes.
onViewModeChange(mode: ViewMode) => voidView mode change callback.
actionsReactNodeExtra action buttons on the right.
classNamestringAdditional CSS classes.

DataTableFilter

PropertyTypeDescription
idstringUnique filter identifier.
labelstringDisplay label.
optionsArray<{ label, value, count? }>Available filter options.
selectedstring[]Currently selected values.

ColumnVisibility

PropertyTypeDescription
idstringColumn identifier.
labelstringDisplay label.
visiblebooleanWhether column is visible.

Accessibility

  • Search input has aria-label for screen readers.
  • Filter and column dropdowns are fully keyboard navigable.
  • Clear button removes all active filters at once.
  • View mode buttons use aria-pressed to indicate active state.
  • All interactive elements have visible focus rings.

For best results, pair DataTableToolbar with DataTable so that filter and column visibility state is shared between the toolbar and the table body.


Design Tokens

TokenUsage
--backgroundInput and dropdown background
--foregroundText color
--muted-foregroundPlaceholder text, counts
--borderInput and dropdown borders
--primaryActive filter badge, checkbox
--mutedHover backgrounds
--radius-mdInput and button radius
--duration-fastTransition speed

On this page