ComponentsData Display
Table
Semantic HTML table components for structured data display.
Basic Table
| Name | Role | |
|---|---|---|
| Alice | alice@example.com | Admin |
| Bob | bob@example.com | Editor |
| Carol | carol@example.com | Viewer |
With Caption
Use TableCaption to add a visible description of the table.
| Plan | Subscribers | Revenue |
|---|---|---|
| Starter | 1,240 | $12,400 |
| Pro | 830 | $41,500 |
With Footer
Use TableFooter for summary rows such as totals.
| Item | Qty | Price |
|---|---|---|
| Widget A | 3 | $30.00 |
| Widget B | 2 | $24.00 |
| Total | $54.00 | |
Installation
npx visor add tableThis copies two files into your project:
components/ui/table/table.tsx— the componentcomponents/ui/table/table.module.css— the styles
Usage
import {
Table, TableHeader, TableBody, TableRow, TableHead, TableCell
} from '@/components/ui/table/table';
export default function Example() {
return (
<Table>
<TableHeader>
<TableRow>
<TableHead>Name</TableHead>
<TableHead>Email</TableHead>
</TableRow>
</TableHeader>
<TableBody>
<TableRow>
<TableCell>Alice</TableCell>
<TableCell>alice@example.com</TableCell>
</TableRow>
</TableBody>
</Table>
);
}API Reference
TableProps
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Additional CSS class names for the table element. |
scope | 'col' | 'row' | 'col' | Scope attribute for TableHead cells. |
Sub-components
| Component | Element | Purpose |
|---|---|---|
Table | <table> | Root table element, wrapped in a scroll container |
TableHeader | <thead> | Header section |
TableBody | <tbody> | Body section |
TableFooter | <tfoot> | Footer section (totals, summaries) |
TableRow | <tr> | Table row |
TableHead | <th> | Header cell, defaults to scope="col" |
TableCell | <td> | Data cell |
TableCaption | <caption> | Visible table description |
Accessibility
- Uses native semantic HTML elements (
<table>,<thead>,<tbody>,<th>,<td>) for maximum screen reader compatibility. TableHeadrenders<th>withscope="col"by default. Passscope="row"for row headers.- Add a
TableCaptionto give the table a programmatically associated description — this is especially important for data tables. - For complex tables, use
colSpanandrowSpanprops onTableHead/TableCellas needed. - The outer scroll container ensures the table remains accessible on small viewports.
Status Dot
A 6×6px tone-tinted indicator dot. Five tones resolve from Visor semantic tokens — composes inside badges, table rows, activity feed items, and inline status text.
Timeline
A vertical timeline component for displaying chronological events with status indicators, custom icons, and timestamps.