import { Button } from "@senvenli/react/action";
import { Stack } from "@senvenli/react/layout";
export default function Example() {
return (
<Stack direction="horizontal" space="space-100">
<Button variant="primary">Save changes</Button>
<Button>Cancel</Button>
<Button variant="subtle">Reset filters</Button>
<Button variant="link">Show details</Button>
<Button variant="primary" tone="danger">Delete order</Button>
</Stack>
);
}import { Button } from "@senvenli/react/action";Examples
With an icon
An icon before or after the label, or alone with an accessible name.import { Button } from "@senvenli/react/action";
import { Stack } from "@senvenli/react/layout";
export default function Example() {
return (
<Stack direction="horizontal" space="space-100">
<Button variant="primary" iconBefore="plus">
New order
</Button>
<Button iconAfter="chevron-down">Export</Button>
{/* Without a visible label, the name comes from `aria-label`. */}
<Button iconOnly iconBefore="settings" aria-label="Settings" />
</Stack>
);
}Sizes
Compact for dense tables and toolbars, large for a page's main call to action.import { Button } from "@senvenli/react/action";
import { Stack } from "@senvenli/react/layout";
export default function Example() {
return (
<Stack direction="horizontal" space="space-100">
<Button size="small">Add filter</Button>
<Button>Add filter</Button>
<Button size="large">Add filter</Button>
</Stack>
);
}Disabled and pending
A pending button keeps its width and its name while the work runs.import { Button } from "@senvenli/react/action";
import { Stack } from "@senvenli/react/layout";
export default function Example() {
return (
<Stack direction="horizontal" space="space-100">
<Button isDisabled>Send invoice</Button>
<Button variant="primary" isPending>
Save changes
</Button>
</Stack>
);
}As a link: A call to action that goes somewhere
It looks like a Button and is a real link: it works before JavaScript loads.import { Button } from "@senvenli/react/action";
import { Stack } from "@senvenli/react/layout";
export default function Example() {
return (
<Stack direction="horizontal" space="space-100">
<Button href="#" variant="primary" iconBefore="plus">
Add product
</Button>
<Button href="#">View orders</Button>
</Stack>
);
}As a link: External
Opens in a new tab with the arrow after the label.import { Button } from "@senvenli/react/action";
export default function Example() {
return (
<Button href="https://example.com/docs" isExternal>
Read the documentation
</Button>
);
}As a link: Icon only, and disabled
An icon-only link needs a name; a disabled one has no `href` and cannot be focused.import { Button } from "@senvenli/react/action";
import { Stack } from "@senvenli/react/layout";
export default function Example() {
return (
<Stack direction="horizontal" space="space-100">
<Button href="#" variant="subtle" iconOnly iconBefore="settings" aria-label="Project settings" />
<Button href="#" isDisabled>
View invoice
</Button>
</Stack>
);
}As a link: Handled in place
`onPress` cancels a plain click so the app can respond; a modified click still follows the `href`.import { Button } from "@senvenli/react/action";
import { Text } from "@senvenli/react/display";
import { Stack } from "@senvenli/react/layout";
import { useState } from "react";
export default function Example() {
const [isOpen, setOpen] = useState(false);
return (
<Stack direction="horizontal" space="space-150">
{/* A plain click opens the preview here; Ctrl or Cmd click still opens the link in a new tab. */}
<Button href="https://example.com/invoices/1042" onPress={() => setOpen(true)}>
Preview invoice
</Button>
{isOpen && <Text tone="subtle">Preview opened in place.</Text>}
</Stack>
);
}Radius
`radius`: none, small, medium (the design), large or full; the provider can set it for every component.import { Button } from "@senvenli/react/action";
import { Stack } from "@senvenli/react/layout";
// `radius` on one component; `<DesignSystemProvider defaults={{ radius: "full" }}>` sets it for the whole app.
export default function Example() {
return (
<Stack direction="horizontal" space="space-150">
<Button radius="none">None</Button>
<Button radius="small">Small</Button>
<Button>Medium</Button>
<Button radius="large">Large</Button>
<Button radius="full">Full</Button>
</Stack>
);
}Guidelines
When to use it
- The press changes something on this page: save, send, open a dialog.
- A call to action that navigates: "Add product" to /products/new.
Use something else when
- The action sits inside running text. Link
Do and avoid
- One primary button per view.
- Use danger only to confirm a destructive step.
- Label with a verb in sentence case: "Save changes".
Accessibility
Keyboard
| Keys | What happens |
|---|---|
| Enter, Space | Presses the button. |
| Enter | Follows the link. |
Built in
- Pending and disabled states are exposed to assistive technology.
- A 44px hit area under coarse pointers without changing the layout.
- Keeps link semantics: role link and a real href that works without JavaScript.
You provide
- An
aria-labelwhen the button shows only an icon. - An
aria-labelwhen it shows only an icon.
API reference
Button
| Prop | Type | Default | Description |
|---|---|---|---|
variant | ButtonVariant | – |
|
tone | ButtonTone | – |
|
fullWidth | boolean | – | As wide as its container (a form's submit on a phone, a stacked set of actions). |
radius | ComponentRadius | – | Corner radius: |
size | ButtonSize | – | |
iconBefore | IconName | – | Lucide icon name shown before the label ("plus"). |
iconAfter | IconName | – | Lucide icon name shown after the label. |
children | React.ReactNode | – | |
iconOnly | false | true | – | |
href | string | – | Where it goes. Rendered as a real |
isExternal | boolean | – | Link's convention: opens in a new tab with |
variantButtonVariantprimaryis the one main action of a view;subtlefor toolbars and rows;linkfor a quiet text action.toneButtonTonedangerfor a destructive action (delete, discard); it keeps the variant's shape.fullWidthbooleanAs wide as its container (a form's submit on a phone, a stacked set of actions).
radiusComponentRadiusCorner radius:
none,small,medium(the design),largeorfull(a pill). The provider's default otherwise.sizeButtonSizeiconBeforeIconNameLucide icon name shown before the label ("plus").
iconAfterIconNameLucide icon name shown after the label.
childrenReact.ReactNodeiconOnlyfalse | truehrefstringWhere it goes. Rendered as a real
href, so the link works before (and without) JavaScript.isExternalbooleanLink's convention: opens in a new tab with
noopener noreferrer, showsarrow-up-rightafter the label (unlessiconAfteris set) and tells screen readers it opens a new tab. WithonPressa plain click opens nothing (the app handles it in place), so the arrow and the new-tab words are left out;targetandrelstay for the page before JavaScript. Disabled, it opens nothing either: notarget,relor new-tab words (the arrow stays, asiconAfterwould).