Invoice | Status | Method | Amount |
---|---|---|---|
INV001 | Paid | Credit Card | $250.00 |
INV002 | Pending | PayPal | $125.00 |
INV003 | Unpaid | Bank Transfer | $350.00 |
Table Component
A responsive table component for displaying structured data.
- Clean, minimal design with customizable styling
- Semantic HTML structure with proper accessibility
- Support for captions, headers, and footers
- Built to work well across device sizes
Installation
The Table component is part of our UI library. You can import it directly from the components directory.
Usage
Here is how to use the table in your project.
React TSX
React TSX
Examples
Basic Table
Name | Role | |
---|---|---|
John Doe | john@example.com | Admin |
Jane Smith | jane@example.com | User |
Table with Caption and Footer
Order ID | Customer | Status | Total |
---|---|---|---|
#12345 | John Doe | Shipped | $249.99 |
#12346 | Jane Smith | Processing | $149.99 |
Total Orders: 2 | $399.98 |
API Reference
Table Component Parts
The Table component is composed of several parts:
Component | Description |
---|---|
Table | The root table container |
TableHeader | Container for the table header row(s) |
TableBody | Container for table data rows |
TableFooter | Container for the table footer row(s) |
TableRow | Individual table row |
TableHead | Header cell (<th> element) |
TableCell | Table data cell (<td> element) |
TableCaption | Caption element for the table |
Styling
The Table component comes with sensible default styling:
- Clean borders and spacing between rows
- Subtle hover effects on rows for better legibility
- Proper alignment of header and data cells
- Responsive by default with horizontal scrolling on small screens
Accessibility
The Table component follows web accessibility best practices:
- Uses semantic HTML table elements
- Properly associates header cells with data cells
- Supports captions for table descriptions
- Maintains proper focus management