bon-ui
Table
Primitives from
@/components/element/table, plus DataTable modes for filter, sort, pagination, selection, and fixed columns.Basic
Default DataTable — sorting, filter, and pagination. Columns with size stay that width; Email has no size so it grows to fill leftover space, with minSize={160} as a floor (further shrink scrolls horizontally). Truncate clips long emails within that floor.
| Ava Chen | ava@example.com | Admin | ||
| Ben Ortiz | ben@example.com | Editor | ||
| Cara Nguyen | cara@example.com | Viewer | ||
| Diego Park | diego@example.com | Editor | ||
| Elena Rossi | elena@example.com | Admin |
Page 1 of 3 · 12 rows
Toolbar filters
Compose DataTableToolbar + FilterField above the table. Pass required on a filter to keep it applied (no ×).
| Ava Chen | ava@example.com | Admin | ||
| Ben Ortiz | ben@example.com | Editor | ||
| Elena Rossi | elena@example.com | Admin | ||
| Farid Khan | farid@example.com | Viewer | ||
| Ivy Torres | ivy@example.com | Admin |
Page 1 of 2 · 7 rows
Status filter
variant='line' (default). A single-select underline strip. Each item shows a status and its count. Counts come from the full list, so they stay put while the table shows only the selected status.
| Ava Chen | ava@example.com | Admin | ||
| Ben Ortiz | ben@example.com | Editor | ||
| Cara Nguyen | cara@example.com | Viewer | ||
| Diego Park | diego@example.com | Editor | ||
| Elena Rossi | elena@example.com | Admin |
Page 1 of 3 · 12 rows
Status filter buttons
variant='button'. Same selection, drawn as outline buttons. The pressed button keeps a primary border and wash.
| Ava Chen | ava@example.com | Admin | ||
| Ben Ortiz | ben@example.com | Editor | ||
| Cara Nguyen | cara@example.com | Viewer | ||
| Diego Park | diego@example.com | Editor | ||
| Elena Rossi | elena@example.com | Admin |
Page 1 of 3 · 12 rows
Status filter cards
variant='card'. Each option is a card with a title, description, and count.
| Ava Chen | ava@example.com | Admin | ||
| Ben Ortiz | ben@example.com | Editor | ||
| Cara Nguyen | cara@example.com | Viewer | ||
| Diego Park | diego@example.com | Editor | ||
| Elena Rossi | elena@example.com | Admin |
Page 1 of 3 · 12 rows
Gray background
Pass variant='gray' to render the table on a muted background with a stronger header. Works on both DataTable and the Table primitive.
Page 1 of 3 · 12 rows
Bordered
Pass variant='bordered' for a border on every cell. The grid is for later table-item edit mode.
Page 1 of 3 · 12 rows
With selection
Pass selectable for a checkbox column and select-all on the current page. Selection state is uncontrolled by default.
| Ava Chen | ava@example.com | Admin | |||
| Ben Ortiz | ben@example.com | Editor | |||
| Cara Nguyen | cara@example.com | Viewer | |||
| Diego Park | diego@example.com | Editor | |||
| Elena Rossi | elena@example.com | Admin |
Page 1 of 3 · 12 rows
Controlled selection
Drive selection with rowSelection and onRowSelectionChange.
Selected: 1, 4
| Ava Chen | ava@example.com | Admin | |||
| Ben Ortiz | ben@example.com | Editor | |||
| Cara Nguyen | cara@example.com | Viewer | |||
| Diego Park | diego@example.com | Editor | |||
| Elena Rossi | elena@example.com | Admin |
2 of 12 rows selected
Fixed columns
Pass columnPinning to stick columns on the left and right while the middle columns scroll. Set enableSorting: false on a column (Actions) to skip the sort control.
| Actions | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Ava Chen | ava@example.com | Head of Ops | Platform | San Francisco | 2 min ago | Admin | |||
| Ben Ortiz | ben@example.com | Staff Editor | Content | Austin | 1 hr ago | Editor | |||
| Cara Nguyen | cara@example.com | Support lead | Success | Singapore | Yesterday | Viewer | |||
| Diego Park | diego@example.com | Product editor | Growth | Berlin | 4 days ago | Editor | |||
| Elena Rossi | elena@example.com | Finance admin | Finance | Milan | Just now | Admin |
Page 1 of 2 · 8 rows
NumberValue
Display numbers with a unit before ($ / ¥) or after (%). Use color for positive (green) / negative (red).
$128¥2,001,50010%12%-4%8.5%-
EmailValue
Highlight the local-part; mute @domain for easier scanning in tables and detail rows.
ava@example.comben.ortiz@company.co.uknot-an-email-
Static primitives
Compose markup yourself with Table / TableRow / TableCell when you do not need TanStack behavior.
| Item | SKU | Qty | Price | Rate | Status |
|---|---|---|---|---|---|
| Canvas tote | SKU-1042 | 24 | $48 | 12% | |
| Linen napkin set | SKU-2108 | 8 | $36 | -8.5% | |
| Oak tray | SKU-3310 | 0 | ¥1,500 | - |