Table
Data table with MS-DOS terminal aesthetics and TUI-style borders.
Import
Usage
The Table component provides a declarative grid structure for organizing data with monospace alignment.
| Name | Status | Role |
|---|---|---|
| Alice | Active | Admin |
| Bob | Pending | User |
| Charlie | Active | User |
Props
Table
| Prop | Type | Default | Description |
|---|---|---|---|
| children | React.ReactNode | - | Table content (required) |
| bordered | boolean | false | Whether to show borders between cells |
| striped | boolean | false | Whether to show striped rows |
| size | 'compact' | 'default' | 'default' | Row height |
| className | string | - | Additional CSS class name |
TableRow
| Prop | Type | Default | Description |
|---|---|---|---|
| children | React.ReactNode | - | TableHead or TableCell elements |
| selected | boolean | false | Whether this row is highlighted |
| className | string | - | Additional CSS class name |
TableHead / TableCell
| Prop | Type | Default | Description |
|---|---|---|---|
| children | React.ReactNode | - | Cell content |
| align | 'left' | 'center' | 'right' | 'left' | Text alignment |
| className | string | - | Additional CSS class name |
TableCell (additional)
| Prop | Type | Default | Description |
|---|---|---|---|
| numeric | boolean | false | Enable monospace number alignment |
| truncate | boolean | false | Truncate overflowing text |
TableCaption
| Prop | Type | Default | Description |
|---|---|---|---|
| children | React.ReactNode | - | Caption text |
| position | 'top' | 'bottom' | 'top' | Position relative to table |
Variants
Basic
| Name | Status | Role |
|---|---|---|
| Alice | Active | Admin |
| Bob | Pending | User |
| Charlie | Active | User |
Bordered
| Server | CPU | Memory | Status |
|---|---|---|---|
| web-01 | 45% | 2.1GB | Online |
| web-02 | 62% | 3.4GB | Online |
| db-01 | 78% | 8.2GB | Warning |
Striped
| Command | Description |
|---|---|
| ls | List directory contents |
| cd | Change directory |
| pwd | Print working directory |
| mkdir | Create a directory |
| rm | Remove files or directories |
With Selection
| File | Size | Modified |
|---|---|---|
| document.txt | 12KB | 2024-01-10 |
| image.png | 256KB | 2024-01-12 |
| script.sh | 4KB | 2024-01-14 |