import { Table, TableHeader, TableHead, TableBody, TableRow, TableCell, TableCaption, TableFoot } from "@/components/starwind/table";
<Table class="max-w-md mx-auto">
<TableCaption>Example of a simple table</TableCaption>
<TableHead>Name</TableHead>
<TableHead>Email</TableHead>
<TableHead>Status</TableHead>
<TableCell>Ada Lovelace</TableCell>
<TableCell>ada@starwind.dev</TableCell>
<TableCell>Active</TableCell>
<TableCell>Grace Hopper</TableCell>
<TableCell>grace@starwind.dev</TableCell>
<TableCell>Inactive</TableCell>
<TableCell colspan="3">Total: 2 users</TableCell>
import { Table, TableHeader, TableHead, TableBody, TableRow, TableCell, TableCaption, TableFoot } from "@/components/starwind/table";
export function Example() {
<Table className="max-w-md mx-auto">
<TableCaption>Example of a simple table</TableCaption>
<TableHead>Name</TableHead>
<TableHead>Email</TableHead>
<TableHead>Status</TableHead>
<TableCell>Ada Lovelace</TableCell>
<TableCell>ada@starwind.dev</TableCell>
<TableCell>Active</TableCell>
<TableCell>Grace Hopper</TableCell>
<TableCell>grace@starwind.dev</TableCell>
<TableCell>Inactive</TableCell>
<TableCell colSpan={3}>Total: 2 users</TableCell>
pnpx starwind@latest add table
npx starwind@latest add table
yarn dlx starwind@latest add table
Render a table of recent orders using Astro frontmatter and Starwind UI Table components:
A list of your recent orders.| Order | Status | Customer | Total |
|---|
| ORD1001 | Shipped | Alice Smith | $120.00 |
| ORD1002 | Processing | Bob Johnson | $80.00 |
| ORD1003 | Delivered | Charlie Rose | $200.00 |
| ORD1004 | Cancelled | Dana Lee | $50.00 |
| Total Orders | $450.00 |
{ order: "ORD1001", status: "Shipped", total: "$120.00", customer: "Alice Smith" },
{ order: "ORD1002", status: "Processing", total: "$80.00", customer: "Bob Johnson" },
{ order: "ORD1003", status: "Delivered", total: "$200.00", customer: "Charlie Rose" },
{ order: "ORD1004", status: "Cancelled", total: "$50.00", customer: "Dana Lee" },
<TableCaption>A list of your recent orders.</TableCaption>
<TableHead class="w-[120px]">Order</TableHead>
<TableHead>Status</TableHead>
<TableHead>Customer</TableHead>
<TableHead class="text-right">Total</TableHead>
<TableCell class="font-medium">{order.order}</TableCell>
<TableCell>{order.status}</TableCell>
<TableCell>{order.customer}</TableCell>
<TableCell class="text-right">{order.total}</TableCell>
<TableCell colspan="3">Total Orders</TableCell>
<TableCell class="text-right">$450.00</TableCell>
import { Table, TableBody, TableCaption, TableCell, TableFoot, TableHead, TableHeader, TableRow } from "@/components/starwind/table";
{ order: "ORD1001", status: "Shipped", total: "$120.00", customer: "Alice Smith" },
{ order: "ORD1002", status: "Processing", total: "$80.00", customer: "Bob Johnson" },
{ order: "ORD1003", status: "Delivered", total: "$200.00", customer: "Charlie Rose" },
{ order: "ORD1004", status: "Cancelled", total: "$50.00", customer: "Dana Lee" },
export function Example() {
<TableCaption>A list of your recent orders.</TableCaption>
<TableHead className="w-[120px]">Order</TableHead>
<TableHead>Status</TableHead>
<TableHead>Customer</TableHead>
<TableHead className="text-right">Total</TableHead>
<TableRow key={order.order}>
<TableCell className="font-medium">{order.order}</TableCell>
<TableCell>{order.status}</TableCell>
<TableCell>{order.customer}</TableCell>
<TableCell className="text-right">{order.total}</TableCell>
<TableCell colSpan={3}>Total Orders</TableCell>
<TableCell className="text-right">$450.00</TableCell>
- Named the generated aggregate default export so React and Astro tooling can identify the installed component cleanly.
- Added contract-generated Astro and React implementations while preserving the component’s existing public API and styling.
- Refactor tailwind variants functions into separate
variants.ts file
- Add a
data-slot attribute to all components to enable global styling updates, replacing the current data-table and similar attributes.
- Initial component release with starwind v1.6.0
Layer Metadata
Table is a styled-only component. It uses Starwind styling and markup without a Runtime primitive. Table is available for Astro and React.
styled-component Table Table is a styled-only component. It uses Starwind styling and markup without a Runtime primitive. Table is available for Astro and React. Styled component Behavior Foundation table styled-only Styled only /docs/components/table/ TableBody TableCaption TableCell TableFoot TableHead TableHeader TableRow Root Body Caption Cell Foot Head Header Row TableVariants Layout & Structure layout structure astro react tableBody tableCaption tableCell tableFoot tableHead tableHeader tableRow table-body table-caption table-cell table-container table-foot table-head table-header table-row Astro available Available Astro available React React available table attributes thead attributes tbody attributes tfoot attributes tr attributes th attributes td attributes caption attributes