Skip to content
Zuno UI
Explore components
EXPLORE
Actions
Forms
Layout
Navigation
Data display
Feedback
Overlays
RESOURCES
Components/Button

Button

Clear actions with accessible variants, sizes and states.

Base UI reference ↗

Installation

Run it from the root of a project already set up with zunoui init.

npx zunoui@latest add button

Dependencies

What add button installs alongside the component. The CLI skips any you already have in a compatible version.

ZUNO registry

  • @zuno/utils

npm

Examples

5 examples · 1 component
button

Action hierarchy

From primary emphasis to a text-style action, each variant brings order to the interface.

button

Navigation stays a link

An anchor can look like a button while retaining link semantics and browser navigation.

button

A size for every context

Small, default, large and icon for square actions.

button

Loading without layout shift

The spinner replaces the text without changing the width and prevents double clicks.

button

States that make sense

Disabled actions with native semantics.

API reference

Keeps the props, events and refs of the matching Base UI primitive, plus ZUNO's styles.

PropTypeDefault
variant

Visual treatment and hierarchy of the action.

"default" | "secondary" | "outline" | "ghost" | "destructive" | "link""default"
size

Button size; icon for single-icon actions.

"sm" | "default" | "lg" | "icon""default"
loading

Shows a spinner, disables the button and keeps its width.

booleanfalse
disabled

Disables interaction.

booleanfalse

States

The states that apply to this component and their visual treatment.

StateTreatment
RestSurface per variant; 1 px border on outline and neutral variants.
HoverSubtle surface change with a 120 ms color transition.
Focus visible2 px outline in the ring color, merged with the border, keyboard only.
ActivePress feedback without shifting the content.
Loadingloading shows the Spinner, exposes aria-busy, keeps the width and prevents double submission.
Disableddisabled removes interaction and takes the button out of the Tab order.

Accessibility

Use text that describes the action. With size="icon" or an icon-only button, provide an aria-label.

loading exposes aria-busy, prevents duplicate submissions and keeps the button width; the spinner respects prefers-reduced-motion.

For navigation, pass an anchor or framework link to render; it keeps link semantics. Set type="submit" for form actions.