Overview
The table component library provides a complete set of primitives for building data tables with support for responsive layouts, custom styling, and loading states.Components
TableSkeleton
The main table container component that provides layout structure, scrolling behavior, and loading states. Props:| Prop | Type | Default | Description |
|---|---|---|---|
top | JSX.Element | null | - | Header section (typically HeaderRow) |
middle | JSX.Element | - | Body content (typically BodyRow components) |
bottom | JSX.Element | - | Footer section (optional) |
hideHeadersOnMobile | boolean | false | Hide header on mobile viewports |
isMobile | boolean | - | Mobile viewport flag |
noBorder | boolean | false | Remove outer border |
noBg | boolean | false | Remove background color |
notRounded | boolean | false | Remove rounded corners |
fillSpace | boolean | false | Fill available vertical space |
autoHeight | boolean | false | Automatically adjust height to content |
className | string | - | Custom CSS classes |
innerClassName | string | - | CSS classes for inner container |
loading | boolean | false | Show loading indicator |
overflowAuto | boolean | - | Enable auto overflow behavior |
setIsScrollable | (isScrollable: boolean) => void | - | Callback when scroll state changes |
HeaderRow
Container component for table header cells. Props:| Prop | Type | Default | Description |
|---|---|---|---|
grid | string | - | Required. Tailwind grid classes (e.g., “grid-cols-3”) |
className | string | - | Custom CSS classes |
forceBottomBorder | boolean | false | Force bottom border rendering |
header | boolean | - | Header style flag |
lastColumnJustify | string | - | Justify content for last column |
id | string | - | Element ID |
addScrollPadding | boolean | false | Add padding to account for scrollbar |
children | ReactNode | - | Header cell components |
BodyRow
Container component for table body cells with hover effects. Props:| Prop | Type | Default | Description |
|---|---|---|---|
grid | string | - | Required. Tailwind grid classes |
className | string | - | Custom CSS classes |
forceBottomBorder | boolean | false | Force bottom border |
header | boolean | - | Header style flag |
lastColumnJustify | string | - | Justify content for last column |
isDataRow | boolean | - | Adds data-puppet-tag for testing |
noBorder | boolean | false | Remove border |
onClick | (event: MouseEvent) => void | - | Click handler |
lastChildNoBorder | boolean | - | Remove border from last child |
strongBottomBorder | boolean | - | Stronger bottom border |
children | ReactNode | - | Body cell components |
SummaryRow
Specialized row component for summary or totals rows. Props:| Prop | Type | Default | Description |
|---|---|---|---|
grid | string | - | Required. Tailwind grid classes |
className | string | - | Custom CSS classes |
header | boolean | - | Header style flag |
children | ReactNode | - | Cell components |
HeaderCell
Individual header cell component. Props:| Prop | Type | Default | Description |
|---|---|---|---|
className | string | - | Custom CSS classes |
alignRight | boolean | false | Right-align content |
children | ReactNode | - | Cell content |
BodyCell
Individual body cell component with flexible layout options. Props:| Prop | Type | Default | Description |
|---|---|---|---|
className | string | - | Custom CSS classes for outer wrapper |
innerClassName | string | - | Custom CSS classes for inner content |
onClick | () => void | - | Click handler |
dataPuppetTag | string | - | Test automation identifier |
flexCol | boolean | false | Use flex column layout |
alignCenter | boolean | false | Center-align content |
alignRight | boolean | false | Right-align content |
children | ReactNode | - | Cell content |
TableCellCardValue
Specialized cell component for card-style mobile layouts with label and value. Props:| Prop | Type | Default | Description |
|---|---|---|---|
value | ReactNode | - | Required. Cell value content |
label | string | - | Required. Label text |
icon | JSX.Element | - | Optional icon element |
size | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | - | Text size |
highlight | boolean | false | Apply highlight styling (larger text) |
isMobileTopRow | boolean | false | Adjust padding for first mobile row |
className | string | - | Custom CSS classes |
onClick | () => void | - | Click handler |
Complete Example
Here’s a complete example showing responsive table with loading state:Styling
All table components use Tailwind CSS and can be customized viaclassName props. The components use tailwind-merge to intelligently combine custom classes with defaults.
Grid Layouts
Table rows use CSS Grid for column layouts. Specify grid classes using thegrid prop:
Accessibility
Table components support:- Semantic HTML structure
- Keyboard navigation through interactive elements
- ARIA labels via custom props
- Screen reader friendly content
Related Components
Also exported from the Tables module:BodyCellWrapper- Lower-level cell wrapperHeaderCellWrapper- Lower-level header wrapperBodyRowWrapper- Lower-level row wrapperTableRowWrapper- Generic row wrapper