Invoices
The whole family: a header with a double rule, rows ruled by hand in pencil, a footer with its own double rule and a caption written underneath. Hover a row to see the swipe.
Rows and columns on a ruled page. Every rule is a pencil pull drawn once by the pen and printed by CSS (so a hundred rows cost no drawings), the header has an accountant's double rule, and a hovered or selected row is a highlighter swipe.
npx shadcn@latest add @wobko/tableFirst time here? Add the registry to components.json first. How to install
The whole family: a header with a double rule, rows ruled by hand in pencil, a footer with its own double rule and a caption written underneath. Hover a row to see the swipe.
Sorting, selection and pagination with plain React state and no extra dependency. A selected row is a highlighter swipe (`data-state="selected"`), the sorted column says so with `aria-sort` and an arrow, and the header checkbox goes half-ticked when only some rows are chosen. Colored pencil text is 4.7:1 on paper but about 4:1 on the full swipe, so a chosen row writes its status in ink.
`sticky` pins the header row while the body scrolls under it; `containerClassName="max-h-72"` gives the scroller its height. The header carries the paper color (`--ll-table-bg`) and its own double rule.
A real screen: a card holding a table of people with faces, roles, a presence dot and what each seat costs, a highlighted row for the person you are looking at, a row button, and a footer with the total.
Official `table-demo`: seven invoices with a caption, a header, a footer total and a right-aligned amount column. The ruling is pencil: a double rule under the header, a hand-pulled line under each row, the accountant's pair above the total. Row rules are painted by CSS, so a long table costs no drawing per row.
Official `data-table-demo`, rebuilt with plain React state and no TanStack: filter the emails, sort the Email column, hide columns from the Columns menu, tick rows (the header box goes half-ticked when only some of a page are), and page with Previous and Next. Chosen rows are a highlighter swipe. The original's five rows fit on one page, so this one has twelve at five a page. The bordered, rounded wrapper is left off: the table is already ruled by hand.
A `<table>` in a scroll container. The container is padded 12 px and pulled back by 12 px (layout unchanged) so a focus ring or swipe at the edge is not clipped. `className` goes to the table, `containerClassName` to the container. The other parts read a context from it and throw a readable error when used outside a `Table` (a browser would drop a stray `<tr>` anyway).
| Prop | Type | Default | Description |
|---|---|---|---|
| sticky | boolean | false | Pin the header row to the top of the container while the body scrolls. Give the container a height with `containerClassName="max-h-72"`. The header takes `--ll-table-bg` (default the card color) so rows scroll under it. |
| containerClassName | string | - | Classes for the scroll container (height, max-width, a different bleed). The container's padding is transparent but real: it overlaps 12 px of whatever sits directly above or below the table, so keep a gap of at least 12 px (a `gap-4` or `mt-4` is plenty), or take the bleed away with `containerClassName="m-0 w-full p-0"` when nothing at the table's edge draws outside its box. |
The files the CLI copies into your project.
Loading the source