shadcn.io is not affiliated with official shadcn/ui
Table examples · Standard
Basic Table for React
A bordered table of users with their email, location, status and balance.
The plain Table: a header row of labels and one row per person, inside a bordered frame. TableHeader, TableBody, TableRow, TableHead and TableCell render the native table elements, so the rows and columns are announced as a table. The balance column is aligned to the trailing edge so the amounts line up. Start here for user lists, account summaries and any read-only list of records.
Preview
Installation
FAQ
Which parts make up this table?
Table renders the <table>. TableHeader holds the label row, TableBody holds the records, and each person is a TableRow of TableCells. The demo maps the users array into four rows.
How is the balance column aligned?
text-end on the Balance TableHead and on each balance TableCell lines the amounts up on the trailing edge. Name, email, location and status stay at the start.
Why is the name medium weight?
font-medium on the name TableCell makes the person the row's label. Every cell inherits the table's text-sm.
What is the row key?
Each TableRow uses user.email as its key. The emails in this array are unique, so a row keeps its identity when the list renders again.
Related
- Table with AvatarA table of team members with an avatar
- Table Without DividersA table of products with no lines between
- Striped TableA table of transactions with every other
- Basic Data Table with CheckboxesA table of products with a checkbox on
- Standard CardA basic card with a title, a description
- Badge with Text (Standard)A default badge with a short label for a