Component reference
Table
Semantic table primitives when your application owns the data behavior.
Preview
Live previewOptional six-digit hex. Clear to restore the preset. Check contrast with your brand color.
Changes apply to this preview only.
Loading the interactive example?
Width adapts to the available space
"use client";
import {
Badge,
Table,
TableBody,
TableCell,
TableHead,
TableHeader,
TableRow
} from "@pimolu/react";
export function TableExample() {
return (
<Table caption="Workspace projects" striped>
<TableHeader>
<TableRow>
<TableHead>Project</TableHead>
<TableHead>Status</TableHead>
</TableRow>
</TableHeader>
<TableBody>
<TableRow>
<TableHead scope="row">Atlas</TableHead>
<TableCell>
<Badge
variant="success"
>
Live
</Badge>
</TableCell>
</TableRow>
<TableRow>
<TableHead
scope="row"
>
Orbit
</TableHead>
<TableCell>
<Badge
variant="warning"
>
Review
</Badge>
</TableCell>
</TableRow>
</TableBody>
</Table>
);
}More examples
Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.
Pricing table
TableHeader, TableBody and TableFooter keep the native table structure; a row header names each plan.
Densities
sm, md and lg change padding, body type and header type together.
Treatments
striped alternates body rows; bordered draws cell borders. They compose.
Usage
Compose TableHeader, TableBody, TableRow, TableHead and TableCell. Use caption to explain the dataset and density to change row spacing.
Table does not add sorting, selection or pagination on its own. Use DataTable or DataGrid for those workflows, and preserve contained horizontal scrolling when columns need room.
API reference
Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.
PimoluTableProps
Type source| Name | Type | Default | Description |
|---|---|---|---|
density | PimoluTableDensity | undefined | "md" | Row density. Defaults to "md". |
striped | boolean | undefined | false | Alternate the background of body rows. Defaults to false. |
bordered | boolean | undefined | false | Draw borders around the table and its cells. Defaults to false. |
stickyHeader | boolean | undefined | false | Keep the header visible while the wrapper scrolls. Defaults to false. |
caption | ReactNode | — | Convenience caption rendered before the children. |
containerClassName | string | undefined | — | Extra class for the horizontal-scroll wrapper. |
containerProps | HTMLAttributes<HTMLDivElement> | undefined | — | Native attributes for the horizontal-scroll wrapper. |
children | ReactNode | — | Public Pimolu prop; see the source declaration for details. |
defaultValue | string | number | readonly string[] | undefined | — | Standard React/HTML attribute. |
className | string | undefined | — | Standard React/HTML attribute. |
style | CSSProperties | undefined | — | Standard React/HTML attribute. |
aria-label | string | undefined | — | Defines a string value that labels the current element. |
onChange | ChangeEventHandler<HTMLTableElement, Element> | undefined | — | Standard React/HTML attribute. |
onClick | MouseEventHandler<HTMLTableElement> | undefined | — | Standard React/HTML attribute. |
densityPimoluTableDensity | undefinedDefault: "md"
Row density. Defaults to "md".
stripedboolean | undefinedDefault: false
Alternate the background of body rows. Defaults to false.
borderedboolean | undefinedDefault: false
Draw borders around the table and its cells. Defaults to false.
stickyHeaderboolean | undefinedDefault: false
Keep the header visible while the wrapper scrolls. Defaults to false.
captionReactNodeNo default extracted.
Convenience caption rendered before the children.
containerClassNamestring | undefinedNo default extracted.
Extra class for the horizontal-scroll wrapper.
containerPropsHTMLAttributes<HTMLDivElement> | undefinedNo default extracted.
Native attributes for the horizontal-scroll wrapper.
childrenReactNodeNo default extracted.
Public Pimolu prop; see the source declaration for details.
defaultValuestring | number | readonly string[] | undefinedNo default extracted.
Standard React/HTML attribute.
classNamestring | undefinedNo default extracted.
Standard React/HTML attribute.
styleCSSProperties | undefinedNo default extracted.
Standard React/HTML attribute.
aria-labelstring | undefinedNo default extracted.
Defines a string value that labels the current element.
onChangeChangeEventHandler<HTMLTableElement, Element> | undefinedNo default extracted.
Standard React/HTML attribute.
onClickMouseEventHandler<HTMLTableElement> | undefinedNo default extracted.
Standard React/HTML attribute.
PimoluTableHeaderProps
Type source| Name | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | Public Pimolu prop; see the source declaration for details. |
defaultValue | string | number | readonly string[] | undefined | — | Standard React/HTML attribute. |
className | string | undefined | — | Standard React/HTML attribute. |
style | CSSProperties | undefined | — | Standard React/HTML attribute. |
aria-label | string | undefined | — | Defines a string value that labels the current element. |
onChange | ChangeEventHandler<HTMLTableSectionElement, Element> | undefined | — | Standard React/HTML attribute. |
onClick | MouseEventHandler<HTMLTableSectionElement> | undefined | — | Standard React/HTML attribute. |
childrenReactNodeNo default extracted.
Public Pimolu prop; see the source declaration for details.
defaultValuestring | number | readonly string[] | undefinedNo default extracted.
Standard React/HTML attribute.
classNamestring | undefinedNo default extracted.
Standard React/HTML attribute.
styleCSSProperties | undefinedNo default extracted.
Standard React/HTML attribute.
aria-labelstring | undefinedNo default extracted.
Defines a string value that labels the current element.
onChangeChangeEventHandler<HTMLTableSectionElement, Element> | undefinedNo default extracted.
Standard React/HTML attribute.
onClickMouseEventHandler<HTMLTableSectionElement> | undefinedNo default extracted.
Standard React/HTML attribute.
PimoluTableBodyProps
Type source| Name | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | Public Pimolu prop; see the source declaration for details. |
defaultValue | string | number | readonly string[] | undefined | — | Standard React/HTML attribute. |
className | string | undefined | — | Standard React/HTML attribute. |
style | CSSProperties | undefined | — | Standard React/HTML attribute. |
aria-label | string | undefined | — | Defines a string value that labels the current element. |
onChange | ChangeEventHandler<HTMLTableSectionElement, Element> | undefined | — | Standard React/HTML attribute. |
onClick | MouseEventHandler<HTMLTableSectionElement> | undefined | — | Standard React/HTML attribute. |
childrenReactNodeNo default extracted.
Public Pimolu prop; see the source declaration for details.
defaultValuestring | number | readonly string[] | undefinedNo default extracted.
Standard React/HTML attribute.
classNamestring | undefinedNo default extracted.
Standard React/HTML attribute.
styleCSSProperties | undefinedNo default extracted.
Standard React/HTML attribute.
aria-labelstring | undefinedNo default extracted.
Defines a string value that labels the current element.
onChangeChangeEventHandler<HTMLTableSectionElement, Element> | undefinedNo default extracted.
Standard React/HTML attribute.
onClickMouseEventHandler<HTMLTableSectionElement> | undefinedNo default extracted.
Standard React/HTML attribute.
PimoluTableFooterProps
Type source| Name | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | Public Pimolu prop; see the source declaration for details. |
defaultValue | string | number | readonly string[] | undefined | — | Standard React/HTML attribute. |
className | string | undefined | — | Standard React/HTML attribute. |
style | CSSProperties | undefined | — | Standard React/HTML attribute. |
aria-label | string | undefined | — | Defines a string value that labels the current element. |
onChange | ChangeEventHandler<HTMLTableSectionElement, Element> | undefined | — | Standard React/HTML attribute. |
onClick | MouseEventHandler<HTMLTableSectionElement> | undefined | — | Standard React/HTML attribute. |
childrenReactNodeNo default extracted.
Public Pimolu prop; see the source declaration for details.
defaultValuestring | number | readonly string[] | undefinedNo default extracted.
Standard React/HTML attribute.
classNamestring | undefinedNo default extracted.
Standard React/HTML attribute.
styleCSSProperties | undefinedNo default extracted.
Standard React/HTML attribute.
aria-labelstring | undefinedNo default extracted.
Defines a string value that labels the current element.
onChangeChangeEventHandler<HTMLTableSectionElement, Element> | undefinedNo default extracted.
Standard React/HTML attribute.
onClickMouseEventHandler<HTMLTableSectionElement> | undefinedNo default extracted.
Standard React/HTML attribute.
PimoluTableRowProps
Type source| Name | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | Public Pimolu prop; see the source declaration for details. |
defaultValue | string | number | readonly string[] | undefined | — | Standard React/HTML attribute. |
className | string | undefined | — | Standard React/HTML attribute. |
style | CSSProperties | undefined | — | Standard React/HTML attribute. |
aria-label | string | undefined | — | Defines a string value that labels the current element. |
onChange | ChangeEventHandler<HTMLTableRowElement, Element> | undefined | — | Standard React/HTML attribute. |
onClick | MouseEventHandler<HTMLTableRowElement> | undefined | — | Standard React/HTML attribute. |
childrenReactNodeNo default extracted.
Public Pimolu prop; see the source declaration for details.
defaultValuestring | number | readonly string[] | undefinedNo default extracted.
Standard React/HTML attribute.
classNamestring | undefinedNo default extracted.
Standard React/HTML attribute.
styleCSSProperties | undefinedNo default extracted.
Standard React/HTML attribute.
aria-labelstring | undefinedNo default extracted.
Defines a string value that labels the current element.
onChangeChangeEventHandler<HTMLTableRowElement, Element> | undefinedNo default extracted.
Standard React/HTML attribute.
onClickMouseEventHandler<HTMLTableRowElement> | undefinedNo default extracted.
Standard React/HTML attribute.
PimoluTableHeadProps
Type source| Name | Type | Default | Description |
|---|---|---|---|
scope | "col" | "row" | "colgroup" | "rowgroup" | undefined | "col" | Native scope, defaulting to "col". |
defaultValue | string | number | readonly string[] | undefined | — | Standard React/HTML attribute. |
className | string | undefined | — | Standard React/HTML attribute. |
style | CSSProperties | undefined | — | Standard React/HTML attribute. |
aria-label | string | undefined | — | Defines a string value that labels the current element. |
children | ReactNode | — | Standard React/HTML attribute. |
onChange | ChangeEventHandler<HTMLTableCellElement, Element> | undefined | — | Standard React/HTML attribute. |
onClick | MouseEventHandler<HTMLTableCellElement> | undefined | — | Standard React/HTML attribute. |
scope"col" | "row" | "colgroup" | "rowgroup" | undefinedDefault: "col"
Native scope, defaulting to "col".
defaultValuestring | number | readonly string[] | undefinedNo default extracted.
Standard React/HTML attribute.
classNamestring | undefinedNo default extracted.
Standard React/HTML attribute.
styleCSSProperties | undefinedNo default extracted.
Standard React/HTML attribute.
aria-labelstring | undefinedNo default extracted.
Defines a string value that labels the current element.
childrenReactNodeNo default extracted.
Standard React/HTML attribute.
onChangeChangeEventHandler<HTMLTableCellElement, Element> | undefinedNo default extracted.
Standard React/HTML attribute.
onClickMouseEventHandler<HTMLTableCellElement> | undefinedNo default extracted.
Standard React/HTML attribute.
PimoluTableCellProps
Type source| Name | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | Public Pimolu prop; see the source declaration for details. |
defaultValue | string | number | readonly string[] | undefined | — | Standard React/HTML attribute. |
className | string | undefined | — | Standard React/HTML attribute. |
style | CSSProperties | undefined | — | Standard React/HTML attribute. |
aria-label | string | undefined | — | Defines a string value that labels the current element. |
onChange | ChangeEventHandler<HTMLTableCellElement, Element> | undefined | — | Standard React/HTML attribute. |
onClick | MouseEventHandler<HTMLTableCellElement> | undefined | — | Standard React/HTML attribute. |
childrenReactNodeNo default extracted.
Public Pimolu prop; see the source declaration for details.
defaultValuestring | number | readonly string[] | undefinedNo default extracted.
Standard React/HTML attribute.
classNamestring | undefinedNo default extracted.
Standard React/HTML attribute.
styleCSSProperties | undefinedNo default extracted.
Standard React/HTML attribute.
aria-labelstring | undefinedNo default extracted.
Defines a string value that labels the current element.
onChangeChangeEventHandler<HTMLTableCellElement, Element> | undefinedNo default extracted.
Standard React/HTML attribute.
onClickMouseEventHandler<HTMLTableCellElement> | undefinedNo default extracted.
Standard React/HTML attribute.
PimoluTableCaptionProps
Type source| Name | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | Public Pimolu prop; see the source declaration for details. |
defaultValue | string | number | readonly string[] | undefined | — | Standard React/HTML attribute. |
className | string | undefined | — | Standard React/HTML attribute. |
style | CSSProperties | undefined | — | Standard React/HTML attribute. |
aria-label | string | undefined | — | Defines a string value that labels the current element. |
onChange | ChangeEventHandler<HTMLTableCaptionElement, Element> | undefined | — | Standard React/HTML attribute. |
onClick | MouseEventHandler<HTMLTableCaptionElement> | undefined | — | Standard React/HTML attribute. |
childrenReactNodeNo default extracted.
Public Pimolu prop; see the source declaration for details.
defaultValuestring | number | readonly string[] | undefinedNo default extracted.
Standard React/HTML attribute.
classNamestring | undefinedNo default extracted.
Standard React/HTML attribute.
styleCSSProperties | undefinedNo default extracted.
Standard React/HTML attribute.
aria-labelstring | undefinedNo default extracted.
Defines a string value that labels the current element.
onChangeChangeEventHandler<HTMLTableCaptionElement, Element> | undefinedNo default extracted.
Standard React/HTML attribute.
onClickMouseEventHandler<HTMLTableCaptionElement> | undefinedNo default extracted.
Standard React/HTML attribute.
Accessibility
- Keep column headings and the caption descriptive. TableHead defaults to scope=col.
- For a row heading, use TableHead with scope=row. Do not rebuild tabular relationships with generic div elements.