Components
Table
Semantic HTML table with sortable columns, striped rows, hover states, and caption support.
Import
Usage
Sortable columns
Table Props
| Prop | Type | Default | Description |
|---|---|---|---|
caption | string | — | <caption> text for screen readers |
striped | boolean | false | Alternating row background colours |
hoverable | boolean | false | Highlight row on hover |
stickyHeader | boolean | false | Pin header row while scrolling |
className | string | — | Additional CSS classes |
TableHeader Props
| Prop | Type | Default | Description |
|---|---|---|---|
sortable | boolean | false | Show sort indicator |
sortDirection | 'asc' | 'desc' | undefined | — | Current sort direction |
onSort | () => void | — | Called when header is clicked to sort |
align | 'left' | 'center' | 'right' | 'left' | Text alignment |
TableCell Props
| Prop | Type | Default | Description |
|---|---|---|---|
align | 'left' | 'center' | 'right' | 'left' | Text alignment |
colSpan | number | — | Span multiple columns |
Responsive
Wrap in a scroll container for small screens:
Empty state
Accessibility
- Semantic
<table>,<thead>,<tbody>,<th>,<td>elements captionrenders a<caption>for screen reader context- Sortable headers have
aria-sortattribute (ascending/descending) scope="col"on all<th>elements
Related
- EmptyState — no-data placeholder
- Badge — status indicators in cells