A composable data table with semantic markup and a per-row hover highlight that dims into the active row.
Interaction Type
Hover a row to highlight it; cell text sharpens to full contrast on the active row.
Props
Options you can pass to customize this component.
classNameAdditional CSS classes on the <table> element.
Installation
How to use
import {
Table,
TableBody,
TableCell,
TableHead,
TableHeader,
TableRow,
} from "@/components/ui/table"
export function Demo() {
return (
<Table>
<TableHeader>
<TableRow>
<TableHead>Name</TableHead>
<TableHead>Role</TableHead>
</TableRow>
</TableHeader>
<TableBody>
<TableRow isBodyRow>
<TableCell>Ada Lovelace</TableCell>
<TableCell>Engineer</TableCell>
</TableRow>
</TableBody>
</Table>
)
}Source Code
Click the code icon in the top-right corner to view the source code.
License & Usage
// No code loaded.| Name | Role | Status |
|---|---|---|
| Ada Lovelace | Engineer | Active |
| Alan Turing | Researcher | Active |
| Grace Hopper | Admiral | Retired |