Button
Runs an action. Built on ui-sdk's Button: Enter and Space press it, a returned Promise keeps it busy, and render turns it into a link. Four intents and four sizes, from the Refined UI Components page.
BetaReady to use. Its API can still change in a minor release; the changelog says when.
import { Button, IconButton } from "@leap-crm/design-system";Playground
Change a prop and the component follows. Its code is under Props.
Button
Props
children
intent
size
loading
showResult
result
icon
disabled
render
IconButton
Props
intent
size
loading
disabled
Best practices
When to use it, and the rules that apply in particular places.
| Guidance | Practice |
|---|---|
| Do | Use primary for the main action and outline for the actions beside it, like Save and Cancel. Use ghost in toolbars and rows, and destructive for deleting. |
| Do | Return a Promise from onClick, so the button stays busy until the work settles. Use loading only for busy state that comes from outside, like a mutation. |
| Do | Pass showResult with labels, like { done: "Saved", error: "Couldn't save" }, when the outcome should be announced. The button's own name never changes. |
| Do | Pass an <a> or a router link to render when the button navigates, like Download agreement, so it keeps link semantics. |
| Don't | Use xs (28 px) for a primary action or anything used on touch. Those need a 44 px hit target; keep xs for dense rows and toolbars. |
| Don't | Put a Button inside a sentence or a paragraph. Use TextLink for an action that reads as part of the text. |
Props
Both also take every prop of ui-sdk's Button: onClick, disabled, focusableWhenDisabled, type, pendingAnnouncement and render.
Button
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | What it shows inside. |
| intent | "primary" | "outline" | "ghost" | "destructive" | "primary" | primary for the main action, outline beside it, ghost in toolbars and rows, destructive for deleting. |
| size | "xs" | "sm" | "md" | "lg" | — | xs 28 · sm 32 · md 36 (the default) · lg 40. |
| icon | ReactNode | — | Leading icon. It turns into the spinner while the button is busy, and back. |
| loading | boolean | false | Busy from outside state, like a mutation. Prefer returning a Promise from onClick. |
| showResult | boolean | ButtonResultLabels | false | When onClick's Promise settles, the spinner turns into a tick (resolved) or a cross (rejected) for a moment before the icon returns. Pass labels to have the outcome announced. |
| result | "done" | "error" | — | Holds a result mark in place of the icon, like the option a lawyer already picked on a card. A showResult tick settles into it without redrawing. |
| className | string | — | Classes added to the root element, merged with its own. Tokens only. |
IconButton
| Prop | Type | Default | Description |
|---|---|---|---|
| icon * | ReactNode | — | The only content. It turns into the spinner while the button is busy, and back. |
| aria-label * | string | — | An icon-only button has no visible text, so its name is required. |
| intent | "primary" | "outline" | "ghost" | "destructive" | "ghost" | primary for the main action, outline beside it, ghost in toolbars and rows, destructive for deleting. |
Code
What the playground shows, ready to copy.
Button
import { Button } from "@leap-crm/design-system";
<Button>Add contact</Button>IconButton
import { IconButton, PlusIcon } from "@leap-crm/design-system";
<IconButton icon={<PlusIcon />} aria-label="Add contact" />Keyboard
The keys it answers to. Tab moves between components, arrows move within them.
| Keys | What they do |
|---|---|
| EnterSpace | Presses the focused button. |
| Tab | Reaches it. A disabled button is skipped. |









