Button

Buttons with four visual styles, three sizes, a built-in loading state and a focus ring.

Props

PropTypeDefaultDescription
variant'primary' | 'secondary' | 'ghost' | 'danger''primary'Visual style: primary / secondary / ghost / danger
size'sm' | 'md' | 'lg''md'Control size: sm / md / lg
loadingbooleanfalseShows a spinner, disables the button and sets aria-busy
leadingIconReactNode—Icon before the label, scales with the font size; yields to the spinner while loading
trailingIconReactNode—Icon after the label, scales with the font size; hidden while loading
iconOnlybooleanfalseIcon-only button: drops the horizontal padding and becomes square; provide an aria-label
circlebooleanfalseCircle button: square with a full radius, ideal for icons; provide an aria-label
childrenReactNode—Button content
...restButtonHTMLAttributes—Remaining props are forwarded to the native button