Component docs
Loading
import { IconButton } from "@pixxl-tools/components";
// In Server Components:
import { IconButton } from "@pixxl-tools/components/server";| Prop | Type | Default | Description |
|---|---|---|---|
label (required) | string | — | Accessible name (aria-label); the icon itself is decorative. |
pressed | boolean | — | aria-pressed for a toggle whose state you manage. |
size | ButtonSize | — | Control height: xs 24, sm 32, md 40 (default), lg 48 px. |
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. |
tone | ButtonTone | — | Color role. Default "neutral". |
labelrequiredstring
Accessible name (aria-label); the icon itself is decorative.
pressedboolean
aria-pressed for a toggle whose state you manage.
sizeButtonSize
Control height: xs 24, sm 32, md 40 (default), lg 48 px.
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.
toneButtonTone
Color role. Default "neutral".
Complex object props use fixed fixtures. Primitive props stay editable.
<IconButton label="Search" size="md" variant="ghost" pressed={false}><SearchIcon /></IconButton><IconButton label="Search"><SearchIcon /></IconButton><IconButton label="Search" size="md" variant="ghost" pressed={false}><SearchIcon /></IconButton>