Skip to main content

Starwind UI v1.12 is now available!

Table

Example of a simple table
NameEmailStatus
Ada Lovelace[email protected]Active
Grace Hopper[email protected]Inactive
Total: 2 users

Installation

Usage

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

Table

The root table component. Renders a <table> inside a scrollable container.

PropTypeDefault
classstring-
<Table class="max-w-md mx-auto">
<!-- headers, rows, and footers -->
</Table>

TableHeader

Wraps <thead> for header rows.

PropTypeDefault
classstring-
<TableHeader>
<TableRow>
<TableHead>Name</TableHead>
</TableRow>
</TableHeader>

TableHead

Wraps <th> for column headers.

PropTypeDefault
classstring-
<TableHead class="w-[120px]">Order</TableHead>

TableBody

Wraps <tbody> for data rows.

PropTypeDefault
classstring-
<TableBody>
<TableRow>
<TableCell>Row content</TableCell>
</TableRow>
</TableBody>

TableRow

Wraps <tr> for each row.

PropTypeDefault
classstring-
<TableRow>
<TableCell>Cell</TableCell>
</TableRow>

TableCell

Wraps <td> for data cells.

PropTypeDefault
classstring-
<TableCell class="text-right">$120.00</TableCell>

TableCaption

Wraps <caption> for table captions.

PropTypeDefault
classstring-
<TableCaption>A list of your recent orders.</TableCaption>

TableFoot

Wraps <tfoot> for summary rows.

PropTypeDefault
classstring-
<TableFoot>
<TableRow>
<TableCell colspan="3">Total</TableCell>
</TableRow>
</TableFoot>

Changelog

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