Copy to clipboard
| Name | Status | Role |
|---|---|---|
| Alice | Active | Admin |
| Bob | Inactive | User |
Installation
Copy to clipboard
npx bearnie add table
npx bearnie add table
bunx bearnie add table
bunx bearnie add table
pnpm dlx bearnie add table
pnpm dlx bearnie add table
yarn dlx bearnie add table
yarn dlx bearnie add table
Copy to clipboard
import Table from "@/components/ui/table/Table.astro";
import TableHeader from "@/components/ui/table/TableHeader.astro";
import TableBody from "@/components/ui/table/TableBody.astro";
import TableFooter from "@/components/ui/table/TableFooter.astro";
import TableRow from "@/components/ui/table/TableRow.astro";
import TableHead from "@/components/ui/table/TableHead.astro";
import TableCell from "@/components/ui/table/TableCell.astro";
import TableCaption from "@/components/ui/table/TableCaption.astro";
Usage
import {
Table,
TableHeader,
TableBody,
TableRow,
TableHead,
TableCell,
} from "@/components/ui/table"
<Table>
<TableHeader>
<TableRow>
<TableHead>Column</TableHead>
</TableRow>
</TableHeader>
<TableBody>
<TableRow>
<TableCell>Data</TableCell>
</TableRow>
</TableBody>
</Table>
Examples
With caption
Copy to clipboard
| Invoice | Status | Amount |
|---|---|---|
| INV001 | Paid | $250.00 |
| INV002 | Pending | $150.00 |
With footer
Copy to clipboard
| Item | Price |
|---|---|
| Product A | $100.00 |
| Product B | $50.00 |
| Total | $150.00 |
With badges
Copy to clipboard
| Name | Status | Role |
|---|---|---|
| Alice Johnson | Admin | |
| Bob Smith | User |
Anatomy
Table- The root table elementTableHeader- Container for header rowsTableBody- Container for body rowsTableFooter- Container for footer rowsTableRow- A single table rowTableHead- Header cellTableCell- Body/footer cellTableCaption- Table caption text
Props
All Table components accept class for additional CSS classes. They are structural components wrapping native HTML table elements.