import { Button } from "@pixxl-tools/components";
// In Server Components:
import { Button } from "@pixxl-tools/components/server";| Prop | Type | Default | Description |
|---|---|---|---|
fullWidth | boolean | — | Stretch to the container's inline size. |
loading | boolean | — | Busy state: shows a spinner and sets aria-busy + aria-disabled; the button stays focusable but ignores clicks and never submits. |
size | ButtonSize | — | Control height: xs 24, sm 32, md 40 (default), lg 48 px. |
tone | ButtonTone | — | Color role. Default "neutral". |
variant | ButtonVariant | "secondary" | Emphasis. Defaults to "secondary" for the neutral tone and "solid" for colored tones, so <Button> is a secondary button and <Button tone="primary"> the primary call to action. |
asChild | boolean | — | Render the single child element instead, with this component's props, classes, handlers and ref merged in. |
leading | ReactNode | — | Icon or element before the label (decorative; give the button a text label). |
trailing | ReactNode | — | Icon or element after the label. |
fullWidthboolean
Stretch to the container's inline size.
loadingboolean
Busy state: shows a spinner and sets aria-busy + aria-disabled; the button stays focusable but ignores clicks and never submits.
sizeButtonSize
Control height: xs 24, sm 32, md 40 (default), lg 48 px.
toneButtonTone
Color role. Default "neutral".
variantdefault "secondary"ButtonVariant
Emphasis. Defaults to "secondary" for the neutral tone and "solid" for colored tones, so <Button> is a secondary button and <Button tone="primary"> the primary call to action.
asChildboolean
Render the single child element instead, with this component's props, classes, handlers and ref merged in.
leadingReactNode
Icon or element before the label (decorative; give the button a text label).
trailingReactNode
Icon or element after the label.
Other props are passed to the root element (ButtonHTMLAttributes<HTMLButtonElement>), including className, style, id and aria-* attributes.
Complex object props use fixed fixtures. Primitive props stay editable.
<Button size="md" tone="primary" variant="solid" loading={false} fullWidth={false}>Save</Button><Button tone="primary">Save</Button><Button size="md" tone="primary" variant="solid" loading={false} fullWidth={false}>Save</Button>