Table
<Table>TailwindCSS ModulesProduction StableA lightweight, high-performance table primitive built on TanStack Table v8. Provides accessible HTML table semantics, multi-column sorting, row selection checkboxes, animated skeleton loading, and custom cell formatting with zero layout shifts.
npx coloxo add table --style coloxo-cssimport { Table, TableColumn, TableSorting, TableSelection } from '@coloxo/ui';Design Tokens:
1. Interactive Preview
Comprehensive data table showcasing interactive column sorting, multi-row selection, avatars, and custom action menus.
Interactive Transactions Table
| Reference | ||||||
|---|---|---|---|---|---|---|
Acme Cloud Services billing@acmecloud.com | TXN-9021 | $3,840.50 | Paid | 2026-10-12 | ||
Starlight Media Group finance@starlight.io | TXN-9022 | $1,250.00 | Paid | 2026-10-11 | ||
Hyperion Robotics accounts@hyperion.tech | TXN-9023 | €14,890.00 | Pending | 2026-10-10 | ||
Nexus Global Logistics ops@nexuslogistics.com | TXN-9024 | $6,720.80 | Failed | 2026-10-09 | ||
Aura Creative Studio hello@aurastudio.design | TXN-9025 | $450.00 | Refunded | 2026-10-08 | ||
Vanguard Security Labs invoices@vanguardsec.co | TXN-9026 | $9,200.00 | Paid | 2026-10-07 | ||
Zenith Telemetry pay@zenithtelemetry.net | TXN-9027 | €2,150.25 | Paid | 2026-10-06 | ||
Pinnacle AI Systems treasury@pinnacle.ai | TXN-9028 | $18,400.00 | Pending | 2026-10-05 |
date (desc)Showing 8 of 8 settled transactions2. Sorting & Multi-Row Selection
TanStack Table provides sorting algorithms and multi-row selection with shift/indeterminate synchronization.
Interactive Column Sorting
| Hyperion Robotics | €14,890.00 | Pending | 2026-10-10 |
| Nexus Global Logistics | $6,720.80 | Failed | 2026-10-09 |
| Acme Cloud Services | $3,840.50 | Paid | 2026-10-12 |
| Starlight Media Group | $1,250.00 | Paid | 2026-10-11 |
Row Selection (Checkboxes)
data-selected highlight.| Client | Amount | Status | |
|---|---|---|---|
| Acme Cloud Services | $3,840.50 | Paid | |
| Starlight Media Group | $1,250.00 | Paid | |
| Hyperion Robotics | €14,890.00 | Pending | |
| Nexus Global Logistics | $6,720.80 | Failed |
3. States & Feedback
Built-in skeleton loading shimmers and custom empty state placeholders.
Skeleton Loading State
| Reference | |||
|---|---|---|---|
Acme Cloud Services billing@acmecloud.com | TXN-9021 | $3,840.50 | Paid |
Starlight Media Group finance@starlight.io | TXN-9022 | $1,250.00 | Paid |
Hyperion Robotics accounts@hyperion.tech | TXN-9023 | €14,890.00 | Pending |
Empty State
| Reference | |||
|---|---|---|---|
No transactions found No payment records match your current filter criteria. | |||
4. Interactive Props Configurator
Toggle Table props in real-time to preview dynamic behaviors, code generation, and visual layout.
Checkbox column & multi-select
Click headers to sort asc/desc
Pulse skeleton shimmer rows
Centered empty placeholder state
Accessible <caption> atop table
Aura Creative Studio hello@aurastudio.design | $450.00 | Refunded | 2026-10-08 | |
Starlight Media Group finance@starlight.io | $1,250.00 | Paid | 2026-10-11 | |
Acme Cloud Services billing@acmecloud.com | $3,840.50 | Paid | 2026-10-12 | |
Nexus Global Logistics ops@nexuslogistics.com | $6,720.80 | Failed | 2026-10-09 | |
Hyperion Robotics accounts@hyperion.tech | €14,890.00 | Pending | 2026-10-10 |
import { Table, type TableSorting } from "@coloxo/ui";import { useState } from "react";const [sorting, setSorting] = useState<TableSorting>({"id":"amount","desc":false});const [selectedIds, setSelectedIds] = useState<string[]>(["TXN-9021"]);<Table columns={columns.map((column) => ({ ...column, sortable: true }))} data={transactions.slice(0, 5)} sorting={sorting} onSortingChange={setSorting} selection={{ selectedIds, onChange: setSelectedIds, }}/>5. Dark Theme Calibration
Engineered for deep dashboard environments (#0B1120 / slate-900), maintaining strict WCAG 2.1 AA text contrast and subtle slate borders without harsh white lines.
| Cluster | CPU Utilization | Memory | Health | Uptime | ||
|---|---|---|---|---|---|---|
| node-us-east-01 | k8s-prod-primary | 48% | 12.4 / 32 GB | healthy | 99.98% | |
| node-us-east-02 | k8s-prod-primary | 82% | 28.1 / 32 GB | warning | 99.94% | |
| node-eu-west-01 | k8s-eu-edge | 24% | 8.2 / 32 GB | healthy | 100.0% | |
| node-ap-southeast-01 | k8s-apac-failover | 96% | 31.8 / 32 GB | critical | 98.72% |
Selected Row StateHeader ContrastMonospace Alignment6. Enterprise Layout Compositions
Demonstrating Table integration inside Cards, administrative panels, and data dashboards.
| Client | Amount | Status |
|---|---|---|
Acme Cloud Services Visa •••• 4242 | $3,840.50 | Paid |
Starlight Media Group Mastercard •••• 8821 | $1,250.00 | Paid |
Hyperion Robotics Bank Wire (SEPA) | €14,890.00 | Pending |
| Member | Role | Status |
|---|---|---|
Olivia Rhye olivia@coloxo.app | Owner | active |
Phoenix Baker phoenix@coloxo.app | Admin | active |
Lana Steiner lana@coloxo.app | Member | active |
Demi Wilkinson demi@coloxo.app | Member | suspended |
Accessibility
Constructed with semantic <table>, <thead>, <tbody>, <th>, <td>, and optional <caption> elements, allowing screen readers to convey tabular structures, row counts, and column header associations automatically.
Sortable column header cells programmatically declare aria-sort="ascending", aria-sort="descending", or aria-sort="none", announcing active ordering to assistive technologies upon user toggle.
Bulk-selection header checkboxes and row checkboxes include descriptive aria-label="Select all rows" and aria-label="Select row" attributes with proper focus-visible indicator rings.
Sortable headers and row checkboxes are fully operable via Tab, Enter, and Space keys. Interactive controls maintain a minimum 4.5:1 WCAG 2.1 AA color contrast ratio across light and dark modes.
Props
| Name | Type | Default | Description |
|---|---|---|---|
| columns | TableColumn<T>[] | — | Array of column definitions specifying header title, data accessor, custom cell renderers, sortability, and width. |
| data | T[] | — | Dataset array of record objects to render across table rows. |
| sorting | TableSorting | — | Controlled column sorting state: { id: string, desc: boolean } | null. |
| defaultSorting | TableSorting | null | Initial uncontrolled column sorting state. |
| onSortingChange | (sorting: TableSorting) => void | — | Callback fired when the user toggles a sortable column header. |
| selection | TableSelection | — | Row selection configuration object containing selectedIds array and onChange handler. |
| loading | boolean | false | When true, displays 5 animated skeleton shimmer rows in place of data rows. |
| empty | ReactNode | — | Custom empty state component rendered when data contains zero items. Defaults to <EmptyState />. |
| caption | string | — | Accessible caption displayed at the top of the table for screen readers and visible titling. |
| getRowId | (row: T, index: number) => string | — | Custom row key extractor function. Defaults to row.id ?? index. |
| className | string | — | Additional CSS class names applied to the outer table container wrapper. |
TableColumn
Properties configuring individual table columns in the columns array.
| Name | Type | Default | Description |
|---|---|---|---|
| id | string | — | Unique column identifier used for sorting keys and cell mapping. |
| header | ReactNode | — | Header cell content; rendered as text, icon, or custom JSX node. |
| accessor | keyof T | ((row: T) => unknown) | — | Property key on row object or accessor function extracting cell value. |
| cell | (ctx: { row: T; value: unknown }) => ReactNode | — | Custom cell renderer function receiving the current row record and value. |
| sortable | boolean | false | When true, renders clickable header with sort indicator icons and enables TanStack sorting. |
| width | number | string | — | Optional column width in pixels (number) or CSS string. |
TableSelection
Configuration object for row selection.
| Name | Type | Default | Description |
|---|---|---|---|
| selectedIds | string[] | — | Array of selected row IDs matching getRowId or row.id. |
| onChange | (ids: string[]) => void | — | Callback invoked whenever row selection changes (header or row checkboxes). |
TableSorting
Column sorting state representation.
| Name | Type | Default | Description |
|---|---|---|---|
| id | string | — | Column id currently being sorted. |
| desc | boolean | — | True for descending sort direction; false for ascending. |