Button
Triggers an action. Four variants, three tones, three sizes, loading and icon support.
Staticimport { Button } from 'umbra-ui'
Props
Button
| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | false | Render the single child element (e.g. a router link) with button styling instead of a `<button>`. |
endIcon | ReactNode | — | Icon rendered after the label (decorative). |
fullWidth | boolean | false | Stretch to the container width. |
loading | boolean | false | Shows a spinner, sets `aria-busy` and ignores clicks while keeping focus. |
size | "sm" | "md" | "lg" | md | Control height. |
startIcon | ReactNode | — | Icon rendered before the label (decorative). |
tone | "accent" | "neutral" | "danger" | neutral | Colour intent. |
variant | "solid" | "soft" | "outline" | "ghost" | ghost | Visual weight. |
IconButton
| Prop | Type | Default | Description |
|---|---|---|---|
aria-label required | string | — | Accessible name. Required because the button has no visible text. |
children required | ReactNode | — | The icon. |
asChild | boolean | false | Render the single child element (e.g. a router link) with button styling instead of a `<button>`. |
loading | boolean | false | Shows a spinner, sets `aria-busy` and ignores clicks while keeping focus. |
size | "sm" | "md" | "lg" | md | Control height. |
tone | "accent" | "neutral" | "danger" | neutral | Colour intent. |
variant | "solid" | "soft" | "outline" | "ghost" | ghost | Visual weight. |
Usage notes
Use one solid accent button per view for the primary action. asChild renders a link with button styling.
Accessibility
- Native
<button>: Enter and Space activate it. loadingsetsaria-busyandaria-disabledbut keeps the button focusable, so focus is not lost mid-submit.IconButtonrequiresaria-label; icons passed tostartIcon/endIconare hidden from assistive tech.- Focus ring is a 2px outline in
color-focus, which also shows in forced-colors mode.
Import
import { Button, IconButton } from 'umbra-ui';
import 'umbra-ui/styles.css'; // once, at the root of your app