Danger
Destructive action people cannot undo: solid chrome, danger tone.
<Button variant="solid" tone="danger">
Delete item
</Button>Triggers an action — save, submit, delete, open.
import { Button } from "@/fragments/ui";Source<Button variant="solid">Save changes</Button>npx @usefragments/cli add buttonWrites src/fragments/ui/components/Button plus what it imports, the globals stylesheet, and .fragments/registry-lock.json, then prints the packages to add. No account, no key.
Your own registry: publish from Fragments Cloud and add --registry org/name. Connect a workspace.
Destructive action people cannot undo: solid chrome, danger tone.
<Button variant="solid" tone="danger">
Delete item
</Button>Tone is colour and colour is meaning; it works on every variant.
<Stack direction="row" gap="sm" align="center" wrap>
<Button variant="soft" tone="accent">
Accent
</Button>
<Button variant="soft" tone="info">
InfoSquare icon-only action. Always pass aria-label.
<Button icon variant="outline" aria-label="Add item">
<span aria-hidden>+</span>
</Button>sm for inline row actions, lg for hero calls to action.
<Stack direction="row" gap="sm" align="center" wrap>
<Button size="sm">Small</Button>
<Button size="md">Medium</Button>
<Button size="lg">Large</Button>
</Stack>Blocks clicks and drops the button out of the tab order.
<Button disabled>Unavailable</Button>Paints button styles onto an anchor or router link; props forward to the child.
<Button asChild variant="outline" aria-label="Open billing settings">
<a href="#billing-settings">Billing settings</a>
</Button>Long labels stay on one line; shorten the label or give the button room.
<Button>
Save the localized account preferences and notify every affected workspace administrator
</Button>Prop | Type | Default | Description |
|---|---|---|---|
as | enumabutton | Not set | — |
asChild | boolean | Not set | Merge props onto child element instead of rendering a button. Useful for composition with Link components. |
childrenRequired | node | Not set | — |
fullWidth | boolean | Not set | Make button full width of container |
icon | boolean | Not set | Render as icon-only button (square aspect ratio). Always pass `aria-label`. |
size | enumsmmdlg | "md" | Control height. |
tone | enumneutralaccentinfosuccesswarningdanger | Not set | Colour. Defaults to `"accent"` on `solid` and `link`, `"neutral"` on `soft`, `outline` and `ghost`. |
variant | enumsolidsoftoutlineghostlink | "solid" | Chrome family. |
Do not use a Button for plain navigation.
Don’t
<Button href="/settings">Settings</Button>Do
<Link href="/settings">Settings</Link>