Component reference
ApiTable
A compact reference of property contracts.
Preview
Live previewOptional six-digit hex. Clear to restore the preset. Check contrast with your brand color.
Changes apply to this preview only.
| Name | Type | Default | Description |
|---|---|---|---|
variant | "primary" | "secondary" | "danger" | "primary" | Semantic colour of the action. It maps to the same token in every preset. |
appearance | "solid" | "soft" | "outline" | "ghost" | "glass" | "solid" | Visual weight of the button without changing its meaning. |
size | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "md" | Control height and horizontal padding. md matches the default form controls. |
childrenRequired | ReactNode | — | Visible label. Provide an aria-label instead when the button is icon-only. |
loading | boolean | false | Shows a spinner, disables the control and sets aria-busy. |
startIcon | ReactNode | — | Decorative icon rendered before the label; it is hidden from assistive technology. |
onClick | (event: MouseEvent) => void | — | Native click handler. The button does not intercept the event. |
fullWidth | boolean | false | Stretches the button to the inline size of its container. |
iconOnlyDeprecated | boolean | false | Use the icon-only variant instead. The prop remains for one major version. |
Width adapts to the available space
"use client";
import { ApiTable } from "@pimolu/react";
const buttonRows = [
{
name: "variant",
type: '"primary" | "secondary" | "danger"',
default: '"primary"',
description: "Semantic colour of the action. It maps to the same token in every preset.",
},
{
name: "appearance",
type: '"solid" | "soft" | "outline" | "ghost" | "glass"',
default: '"solid"',
description: "Visual weight of the button without changing its meaning.",
},
{
name: "size",
type: '"xs" | "sm" | "md" | "lg" | "xl" | "xxl"',
default: '"md"',
description: "Control height and horizontal padding. md matches the default form controls.",
},
{
name: "children",
type: "ReactNode",
required: true,
description: "Visible label. Provide an aria-label instead when the button is icon-only.",
},
{
name: "loading",
type: "boolean",
default: "false",
description: "Shows a spinner, disables the control and sets aria-busy.",
},
{
name: "startIcon",
type: "ReactNode",
description: "Decorative icon rendered before the label; it is hidden from assistive technology.",
},
{
name: "onClick",
type: "(event: MouseEvent) => void",
description: "Native click handler. The button does not intercept the event.",
},
{
name: "fullWidth",
type: "boolean",
default: "false",
description: "Stretches the button to the inline size of its container.",
},
{
name: "iconOnly",
type: "boolean",
default: "false",
deprecated: true,
description: "Use the icon-only variant instead. The prop remains for one major version.",
},
];
export function DemoExample() {
return (
<div className="min-w-0 rounded-lg border border-border p-6">
<ApiTable
title="Button"
caption="Every prop accepted by Button, with its type and default value."
rows={buttonRows}
/>
</div>
);
}More examples
Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.
Compact reference
density sm tightens the row padding for a reference that sits next to other content.
Deprecated props
Deprecated rows keep their description and receive a badge; the name is struck through so the migration is visible in a diff.
Empty reference
An empty rows array renders a single full-width cell instead of an empty table body.
Usage
Provide accurate types, defaults and descriptions; an empty default is not proof of runtime behavior.
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.
PimoluApiTableRow
Type source| Name | Type | Default | Description |
|---|---|---|---|
nameRequired | string | — | Prop, token or event name. |
typeRequired | ReactNode | — | Accepted type, rendered as code. |
default | ReactNode | — | Default value, rendered as code. Omit when there is none. |
required | boolean | undefined | — | Marks the row as required with a visible badge. |
descriptionRequired | ReactNode | — | Description of the row. |
deprecated | boolean | undefined | — | Marks the row as deprecated with a visible badge. |
nameRequiredstringNo default extracted.
Prop, token or event name.
typeRequiredReactNodeNo default extracted.
Accepted type, rendered as code.
defaultReactNodeNo default extracted.
Default value, rendered as code. Omit when there is none.
requiredboolean | undefinedNo default extracted.
Marks the row as required with a visible badge.
descriptionRequiredReactNodeNo default extracted.
Description of the row.
deprecatedboolean | undefinedNo default extracted.
Marks the row as deprecated with a visible badge.
PimoluApiTableProps
Type source| Name | Type | Default | Description |
|---|---|---|---|
rowsRequired | PimoluApiTableRow[] | — | Public Pimolu prop; see the source declaration for details. |
title | ReactNode | — | Optional title displayed above the table. |
caption | ReactNode | — | Optional caption attached to the table element. |
density | PimoluApiTableDensity | undefined | "md" | Row density. Defaults to "md". |
emptyMessage | ReactNode | "No API entries." | Message shown when rows is empty. Defaults to "No API entries." |
className | string | undefined | — | Public Pimolu prop; see the source declaration for details. |
onChange | ChangeEventHandler<HTMLDivElement, Element> | undefined | — | Standard React/HTML attribute. |
defaultValue | string | number | readonly 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. |
onClick | MouseEventHandler<HTMLDivElement> | undefined | — | Standard React/HTML attribute. |
rowsRequiredPimoluApiTableRow[]No default extracted.
Public Pimolu prop; see the source declaration for details.
titleReactNodeNo default extracted.
Optional title displayed above the table.
captionReactNodeNo default extracted.
Optional caption attached to the table element.
densityPimoluApiTableDensity | undefinedDefault: "md"
Row density. Defaults to "md".
emptyMessageReactNodeDefault: "No API entries."
Message shown when rows is empty. Defaults to "No API entries."
classNamestring | undefinedNo default extracted.
Public Pimolu prop; see the source declaration for details.
onChangeChangeEventHandler<HTMLDivElement, Element> | undefinedNo default extracted.
Standard React/HTML attribute.
defaultValuestring | number | readonly string[] | 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.
onClickMouseEventHandler<HTMLDivElement> | undefinedNo default extracted.
Standard React/HTML attribute.
Accessibility
- Keep row/column headings and contained scrolling available on small screens.