Components
Button
Action button with five variants, four sizes, three shapes and automatic promise loading.
import { Button } from "@openperf/deft";
<Button.Root onClick={save} variant="primary">
Save
</Button.Root>;Variants
| Variant | Notes |
|---|---|
default | Standard bordered button. |
field | Raised contrast on inset surfaces such as List or Panel. |
primary | High-emphasis accent fill for the main action. |
ghost | Transparent until hovered, for secondary and icon actions. |
danger | Destructive actions and confirmations. |
Sizes
| Size | Height | Icon size |
|---|---|---|
md | 28px | 16px |
sm | 26px | 16px |
xs | 22px | 14px |
inline | inherit | 1em |
inline has no fixed height and inherits the surrounding text size.
Shapes
| Shape | Notes |
|---|---|
rect | Default rounded rectangle. |
pill | Fully rounded ends. |
square | Equal width and height for icon-only buttons; set aria-label. |
Loading
Returning a Promise from onClick enables loading automatically until it settles — preserving width, setting aria-busy="true" and blocking repeat clicks. An explicit loading prop overrides it:
<Button.Root loading={save.isPending} onClick={() => save.mutate()} variant="primary">
Save
</Button.Root>Composition
Icon and shortcut
Tabler icons inherit size automatically; Kbd adapts its contrast inside default, field and primary.
import { Button, Kbd } from "@openperf/deft";
import { IconPlus } from "@tabler/icons-react";
<Button.Root variant="primary">
<IconPlus />
New rule
<Kbd.Root>N</Kbd.Root>
</Button.Root>;Router link and triggers
Pass a link to render (type is omitted automatically), or pass <Button.Root /> into a Base UI trigger's render prop:
<Button.Root render={<Link to="/settings" />} variant="ghost">
Settings
</Button.Root>
<Dialog.Trigger render={<Button.Root variant="primary" />}>
Create webhook
</Dialog.Trigger>API
Prop
Type