Components
Table
A semantic table with header, body, footer and caption slots.
Installation
$ npx veil-ui@latest add tableUsage
import {
Table,
TableBody,
TableCell,
TableHead,
TableHeader,
TableRow,
} from "@/components/ui/table";
<Table>
<TableHeader>
<TableRow>
<TableHead>Invoice</TableHead>
<TableHead>Status</TableHead>
</TableRow>
</TableHeader>
<TableBody>
<TableRow>
<TableCell>INV-001</TableCell>
<TableCell>Paid</TableCell>
</TableRow>
</TableBody>
</Table>;Examples
Basic
| Invoice | Status | Method | Amount |
|---|---|---|---|
| INV-001 | Paid | Credit card | $250.00 |
| INV-002 | Pending | PayPal | $150.00 |
| INV-003 | Paid | Bank transfer | $350.00 |
| Total | $750.00 | ||
Selected row
| Name | Role |
|---|---|
| Ada Lovelace | Engineer |
| Grace Hopper | Admiral |
API reference
The package exports table along with its composable parts. It forwards standard attributes to its root element; see the examples above for the component-specific props.
Accessibility
- Content uses semantic HTML — lists are lists, tables are tables and metadata uses a definition list.
- Interactive elements are real buttons or links with visible focus states.
- Images require meaningful
alttext; icons used decoratively arearia-hidden.
Vue and plain HTML
This component also ships for Vue (Reka UI) and plain HTML. Install it with npx veil-ui add table --framework vue or switch the framework in components.json.
<script setup lang="ts">
import { cn } from "@/lib/utils";
defineOptions({ inheritAttrs: false });
const props = defineProps<{ class?: string }>();
</script>
<template>
<div data-slot="table-container" class="relative w-full overflow-x-auto">
<table
data-slot="table"
:class="cn('w-full caption-bottom text-sm', props.class)"
v-bind="$attrs"
>
<slot />
</table>
</div>
</template>