Skip to main content

Starwind UI v3.0 is now available! Migration guide

Example of a simple table
NameEmailStatus
Ada Lovelaceada@starwind.devActive
Grace Hoppergrace@starwind.devInactive
Total: 2 users

Installation

Usage

---
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>
<TableHeader>
<TableRow>
<TableHead>Name</TableHead>
<TableHead>Email</TableHead>
<TableHead>Status</TableHead>
</TableRow>
</TableHeader>
<TableBody>
<TableRow>
<TableCell>Ada Lovelace</TableCell>
<TableCell>ada@starwind.dev</TableCell>
<TableCell>Active</TableCell>
</TableRow>
<TableRow>
<TableCell>Grace Hopper</TableCell>
<TableCell>grace@starwind.dev</TableCell>
<TableCell>Inactive</TableCell>
</TableRow>
</TableBody>
<TableFoot>
<TableRow>
<TableCell colspan="3">Total: 2 users</TableCell>
</TableRow>
</TableFoot>
</Table>

Composition

Use semantic table parts in the same order as native table markup:

Table
├── TableCaption
├── TableHeader
│ └── TableRow
│ └── TableHead
├── TableBody
│ └── TableRow
│ └── TableCell
└── TableFoot
└── TableRow
└── TableCell

Dynamic Data Table Example

Render a table of recent orders using Astro frontmatter and Starwind UI Table components:

A list of your recent orders.
OrderStatusCustomerTotal
ORD1001ShippedAlice Smith$120.00
ORD1002ProcessingBob Johnson$80.00
ORD1003DeliveredCharlie Rose$200.00
ORD1004CancelledDana Lee$50.00
Total Orders$450.00

API Reference

Changelog

View version history v1.2.1 5 releases

v1.2.1

  • Named the generated aggregate default export so React and Astro tooling can identify the installed component cleanly.

v1.2.0

  • Added contract-generated Astro and React implementations while preserving the component’s existing public API and styling.

v1.1.2

  • Refactor tailwind variants functions into separate variants.ts file

v1.1.0

  • Add a data-slot attribute to all components to enable global styling updates, replacing the current data-table and similar attributes.

v1.0.0

  • Initial component release with starwind v1.6.0