- Docs
- Components
- Actions
Button
An action. One solid and one soft per region; everything else ghost.
- Import
- @qeetrix/react
- Status
- StableSince 0.0.2
- Renders
<button>Server-rendered- Tested
- WCAG 2.2 AAaxe on every pull request
01
Playground
Every prop, live, and the code it takes.
Variant
Tone
Size
Icon
import { PlusIcon } from "@qeetrix/icons";
import { Button } from "@qeetrix/react";
<Button icon={PlusIcon}>Invite users</Button>02
Variants and tones
Emphasis from the variant, intent from the tone.
<Stack gap="md">
<Inline gap="md">
<Button>Save changes</Button>
<Button variant="soft">Preview</Button>
<Button variant="ghost">Cancel</Button>
</Inline>
<Inline gap="md">
<Button tone="danger">Delete user</Button>
<Button tone="danger" variant="soft">Revoke key</Button>
<Button tone="danger" variant="ghost">Remove</Button>
</Inline>
<Inline gap="md">
<Button tone="neutral" variant="ghost">Cancel</Button>
</Inline>
</Stack>03
Sizes
Heights from the density tokens: a compact region gets shorter buttons, with no new prop.
<Inline gap="md" align="center">
<Button size="sm">Small</Button>
<Button size="md">Medium</Button>
<Button size="lg">Large</Button>
</Inline>04
With an icon
The icon trails the label, in its own zone. An arrow that points forward flips in right to left.
import { ArrowRightIcon, PlusIcon } from "@qeetrix/icons";
import { Button, Inline, mirrorInRtl } from "@qeetrix/react";
const Next = mirrorInRtl(ArrowRightIcon);
<Inline gap="md">
<Button icon={PlusIcon}>Invite users</Button>
<Button variant="soft" icon={Next}>Continue</Button>
</Inline>05
Loading and disabled
Loading keeps the width and the focus. Disabled stays focusable, so its reason can be read.
<Inline gap="md">
<Button loading icon={PlusIcon}>Saving…</Button>
<Button disabled>Create invoice</Button>
<Button variant="soft" disabled>Preview</Button>
</Inline>06
Full width
Fills its container, its label centred on the whole button: the one action of a narrow form or a phone screen.
<Button fullWidth icon={Next}>Continue with a passkey</Button>