Button

Buttons prompt most actions in a UI.

Props

React props
NameTypeRequiredDefaultDescription
iconIconNoAn optional icon to display in the button (agnostic Icon data).
type"button" | "submit" | "reset"No'button'The HTML button type attribute. Only applies when rendered as `<button>`.
iconPositionButtonIconPosition | ButtonIconPositionAliasNo'start'Logical icon position. The `left` and `right` aliases are retained for compatibility and resolve to `start` and `end` respectively.
size"small" | "large" | "xSmall" | "medium" | "xLarge"No'medium'Visual size; every option retains a 48px touch target.
variantButtonVariant | ButtonVariantAliasNo'filled'The button variant determines the style of the button. Aliases: 'primary' maps to 'filled', 'secondary' maps to 'tonal'
disabledbooleanNofalseDisables the button if set to true.
edgeAlignedbooleanNofalseAligns text-button content with the surrounding inline edge. Only applies to `text` variant buttons.
stateColorstringNoColour token for the state layer, without the `--color-` prefix. Defaults to the token matching the resolved `variant`. Set it when the surface has been restyled through `className` -- a filled button repainted onto a container needs `on-primary-container`, not the `on-primary` the variant implies -- so the hover and press feedback keeps contrasting.
loadingbooleanNofalseBlocks interaction and exposes the busy state while preserving the label.
shape"rounded" | "squared"No'rounded'The shape of the button defines whether it is squared or rounded.
shapeFeedbackButtonShapeFeedbackNo'morph'Shape feedback shown for accepted press and toggle interactions.
transitionTransitionNoMotion transition shared by every framework for shape changes.
toggleablebooleanNofalseEnables the semantic pressed state and its visual treatment.
pressedbooleanNoControlled pressed state. Framework adapters expose the matching change event (`onPressedChange` in React, `pressedChange` in Angular).
defaultPressedbooleanNofalseInitial pressed state when `pressed` is not controlled.
labelstringNoVisible text content. Do not combine with `children`.
childrenReactButtonChildrenNoCustom visible content. Use `aria-label` when it has no accessible text.
classNamestring | ClassNameComponent<ButtonInterface> | Partial<Record<"button" | "label" | "stateLayer" | "touchTarget" | "icon", string>>NoClasses or state-aware element classes applied through the shared style contract.
onPressedChange(pressed: boolean) => voidNoNotifies an accepted toggle-state request.
hrefstringNoNavigation destination; switches the native element from button to link.
refRef<HTMLButtonElement> | Ref<HTMLAnchorElement>NoRef forwarded to the native button element. Ref forwarded to the native anchor element.
onClickMouseEventHandler<HTMLButtonElement> | MouseEventHandler<HTMLAnchorElement>NoHandles clicks accepted by the button interaction contract. Handles clicks accepted by the link interaction contract.