Table Basic
Builds a table row by row, for cells that need their own structure.
| Order ID | Part ID | Source location | Source level | Total volume |
|---|---|---|---|---|
| AB-00032734 | X60 BJGJ29839281 | US, Denver - 24071 | 66% | 10.9985 |
| AB-00032612 | X62 BAGJ28599202 | US, New York - 25018 | 86% | 7.28699 |
| AB-00032736 | X61 BHH09027512 | US, San Francisco - 27381 | 75% | 8.85221 |
Configurations
Supported configurations for this component.
States
Interaction states covered by the API and the style contract.
Configurations
3 examples| Order ID | Part ID | Source location | Source level | Total volume |
|---|---|---|---|---|
| AB-00032734 | X60 BJGJ29839281 | US, Denver - 24071 | 66% | 10.9985 |
| AB-00032612 | X62 BAGJ28599202 | US, New York - 25018 | 86% | 7.28699 |
| AB-00032736 | X61 BHH09027512 | US, San Francisco - 27381 | 75% | 8.85221 |
| Order ID | Part ID | Source location | Source level | Total volume |
|---|---|---|---|---|
| AB-00032734 | X60 BJGJ29839281 | US, Denver - 24071 | 66% | 10.9985 |
| AB-00032612 | X62 BAGJ28599202 | US, New York - 25018 | 86% | 7.28699 |
| AB-00032736 | X61 BHH09027512 | US, San Francisco - 27381 | 75% | 8.85221 |
| Order ID | Part ID | Source location | Source level | Total volume |
|---|---|---|---|---|
| AB-00032734 | X60 BJGJ29839281 | US, Denver - 24071 | 66% | 10.9985 |
| AB-00032612 | X62 BAGJ28599202 | US, New York - 25018 | 86% | 7.28699 |
| AB-00032736 | X61 BHH09027512 | US, San Francisco - 27381 | 75% | 8.85221 |
States
2 examples| Order ID | Part ID | Source location | Source level | Total volume |
|---|---|---|---|---|
| AB-00032734 | X60 BJGJ29839281 | US, Denver - 24071 | 66% | 10.9985 |
| AB-00032612 | X62 BAGJ28599202 | US, New York - 25018 | 86% | 7.28699 |
| AB-00032736 | X61 BHH09027512 | US, San Francisco - 27381 | 75% | 8.85221 |
| Order ID | Part ID | Source location | Source level | Total volume |
|---|---|---|---|---|
| AB-00032734 | X60 BJGJ29839281 | US, Denver - 24071 | 66% | 10.9985 |
| AB-00032612 | X62 BAGJ28599202 | US, New York - 25018 | 86% | 7.28699 |
| AB-00032736 | X61 BHH09027512 | US, San Francisco - 27381 | 75% | 8.85221 |
| Order ID | Part ID | Source location | Source level | Total volume |
|---|---|---|---|---|
| AB-00032734 | X60 BJGJ29839281 | US, Denver - 24071 | 66% | 10.9985 |
| AB-00032612 | X62 BAGJ28599202 | US, New York - 25018 | 86% | 7.28699 |
| AB-00032736 | X61 BHH09027512 | US, San Francisco - 27381 | 75% | 8.85221 |
| Order ID | Part ID | Source location | Source level | Total volume |
|---|---|---|---|---|
| AB-00032734 | X60 BJGJ29839281 | US, Denver - 24071 | 66% | 10.9985 |
| AB-00032612 | X62 BAGJ28599202 | US, New York - 25018 | 86% | 7.28699 |
| AB-00032736 | X61 BHH09027512 | US, San Francisco - 27381 | 75% | 8.85221 |
Add to your project
One command adds this component to your project.
Run the following command. New project? Run npx shadcn@latest init first to set up Tailwind and path aliases.
npx shadcn@latest add @aicanvas/••••••••••••Light and dark both come with the install and follow the dark class on <html>, the shadcn dark mode setup (next-themes with attribute="class").
Props
Every prop this component accepts. Any other prop is forwarded to the underlying element.
TableRow
| Prop | Type | Default | Description |
|---|---|---|---|
| selected | boolean | false | Applies surface.active bg + brand-300 left edge. |
| hoverable | boolean | true | Adds the background-hover class (default true). |
TableHeader
| Prop | Type | Default | Description |
|---|---|---|---|
| sort | 'asc'|'desc'|'sortable'|undefined | - | Column sort state; picks the matching caret and sets aria-sort. |
| align | 'left'|'right'|'center' | 'left' | Horizontal text alignment of the header cell. |
| onSort | () => void | - | Called when the header is activated. With `sort` set, the label and caret render inside a real button, so the column can be sorted by keyboard as well as pointer; the table's order stays the caller's to change. |
TableCell
| Prop | Type | Default | Description |
|---|---|---|---|
| align | 'left'|'right'|'center' | 'left' | Horizontal text alignment of the cell content. |
| muted | boolean | false | Uses text.secondary instead of text.primary. |
| nowrap | boolean | true | Keeps the cell content on a single line when true. |