- 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
Import
// From the package: a build keeps only what it uses.
import { Button } from "@qeetrix/react";
// Or from its own path.
import { Button } from "@qeetrix/react/button";02
Props
And every native attribute of the element it renders.
| Prop | Type | Default | What it does |
|---|---|---|---|
variant | "solid" | "soft" | "ghost" | "solid" | Emphasis: primary, secondary, tertiary. |
tone | "brand" | "danger" | "neutral" | "brand" | danger confirms a destructive flow; neutral is for ghost utility actions. |
size | "sm" | "md" | "lg" | "md" | Height from the density tokens. |
icon | IconSource | — | A trailing icon from @qeetrix/icons, drawn sharp. |
loading | boolean | false | A spinner replaces the icon; clicks are ignored; aria-busy is set. |
fullWidth | boolean | false | Fills its container, its label centred on the whole button. |
disabled | boolean | false | Sets aria-disabled; the button stays focusable. |
render | Button.Props["render"] | — | Another element through Base UI. For navigation, LinkButton: it's announced as a link. |
children | ReactNode | — | The label: a verb. |
03
Parts
Each part carries a data-slot, for tests and placement.
| data-slot | Element | What it is |
|---|---|---|
button | <button> | The root. data-variant, data-tone, data-size; data-icon, data-loading when set. |
button-label | <span> | The label. |
button-zone | <span> | The icon's zone, behind its rule. |
button-icon | <svg> | The icon. |
button-spinner | <span> | In the zone while loading. |
04
A link that looks like one
LinkButton: Button's look, a link's semantics. Enter follows it, and it can open in a new tab.
import { LinkButton } from "@qeetrix/react";
import { Link } from "@tanstack/react-router";
<LinkButton render={<Link to="/users/invite" />} icon={PlusIcon}>Invite users</LinkButton>05
Placement only
className and style place it; its look comes from the props and the tokens.
<Button className="toolbar-end" variant="ghost" tone="neutral">Cancel</Button>