Theme studio

Design a theme, preview it live, then export it. Saved in this browser.

Quick picks #10b981
Generated scale
50100200300400500600700800900
Some text is below AA

TableToolbar

  • Stable
  • WCAG 2.2 evidence
  • RTL

The bar above a data table: a search field and filter chips at the start, table actions at the end. It is a labelled group of three parts. The search field stands alone. The filters and the actions are each a React Aria Toolbar (role="toolbar"), so a keyboard user crosses the bar in three Tab stops and moves between the buttons inside a group with the arrow keys (mirrored in right-to-left layouts); a popup that a button opens returns focus to it on Escape (WCAG 2.1.1, 2.4.3, 4.1.2). Buttons keep their own focus ring (2.4.7) and 32 px height (2.5.8). The bar adapts to its container, not the viewport: in a narrow container the search field fills the row and the actions wrap below, so nothing is hidden or clipped (1.4.10). Use it for tables with more than about ten rows. Consumer duties: the names of the toolbar and of every icon button, the wording of filters, and announcing how many rows a filter or search leaves (announceStatus).

import { TableToolbar } from "@nexera-ui/react";
Loading example…
5
examples
10
props
0
live controls
1
platform
8
WCAG criteria
2
blocks use it

Try every prop. Copy the code.

Change the props and the code updates. Check light and dark, LTR and RTL, and phone width.

Loading…
Generated code
import { TableToolbar } from "@nexera-ui/react";

<TableToolbar />

Examples 4

The same examples as Storybook, rendered live. Open Code to copy one.

Search and action

Only a search field and one action: parts that are not provided are not drawn.

Loading example…

Clear filters

"Clear filters" appears while a filter is applied (onClearFilters) and disappears once they are cleared.

Loading example…

Narrow container

At 20 rem the search field fills the row, the chips wrap, and the actions drop below. Nothing is hidden or clipped.

Loading example…

Right to left

Right-to-left: the search field and filters sit at the start (right), the actions at the end (left), and arrow keys mirror.

Loading example…

Props 10

10 props shown

searchNexera
ReactNode

Search field: pass a <SearchField aria-label="Search employees" /> or an Input. It is 260 px wide from a 480 px container up and fills narrower ones. It is not part of a toolbar (a text field keeps its own arrow keys), so Tab reaches it separately.

Default –
filtersNexera
ReactNode

Filter controls: FilterChips, usually hasDropdown. They sit in a labelled React Aria Toolbar: Tab enters it once and the arrow keys move between the chips (mirrored in right-to-left layouts).

Default –
onClearFiltersNexera
() => void

Called by the "Clear filters" button, which shows after the filters when this is provided. Show it only while a filter is applied, and say how many results remain (announceStatus, WCAG 4.1.3).

Default –
clearFiltersLabelNexera
string

Text of the "Clear filters" button. Translate it.

Default Clear filters
actionsNexera
ReactNode

Buttons and icon buttons at the end. They sit in a labelled React Aria Toolbar. Every icon-only button needs its own aria-label.

Default –
filtersLabelNexera
string

Accessible name of the filters toolbar. Translate it.

Default Filters
actionsLabelNexera
string

Accessible name of the actions toolbar. Translate it.

Default Table actions
classNameNexera
string

Extra classes for the root, merged last so they win over the defaults.

Default –
aria-labelNexera
string

Accessible name of the whole toolbar, for example "Employees table tools". Translate it. Accessible name; aria-labelledby wins when both are set.

Default –
aria-labelledbyNexera
string

Id(s) of element(s) that name the toolbar; wins over aria-label. Id(s) of visible element(s) that name the toolbar.

Default –

* Required. React Aria props shown are the ones most apps use; the component accepts the rest of its React Aria props too.

Accessible by default.

Built on React Aria, and covered by the WCAG 2.2 evidence generated on every build.

WCAG 2.2 evidence

5 direct · 3 supporting
  • 1.3.1Info and RelationshipsLevel A · tested directly
  • 1.3.2Meaningful SequenceLevel A · tested directly
  • 1.4.10ReflowLevel AA · supporting test
  • 2.1.1KeyboardLevel A · tested directly
  • 2.4.3Focus OrderLevel A · tested directly
  • 2.4.7Focus VisibleLevel AA · supporting test
  • 2.5.8Target Size (Minimum)Level AA · supporting test
  • 4.1.2Name, Role, ValueLevel A · tested directly

Fits any width.

Nexera components respond to the space they are given. Drag the corner of the frame, or pick a width.

0 px · drag the corner

Styling hooks

Pass className to add Tailwind classes (merged last). State is exposed as data attributes, so you can style it with variants like data-pressed:.

  • data-disabled
  • data-hovered
  • data-pressed
Usage
<TableToolbar className="data-disabled:opacity-90 shadow-sm" />

Used in blocks

Related components