Button

Button is an extension to standard button element with icons and theming.

PREVIEW

Text to display on a button is provided as the default slot content.

basic-demo

Icons are placed inside the default slot. The position of the icon is expressed by slot order. Add the flex-col class to stack the icon and label vertically.

icons-demo

Render a spinner inside the default slot while toggling disabled to express the busy state.

loading-demo

The button element can be displayed as a link element visually when the link property is present. If you need to customize the rendering, use the as to change the element or asChild for advanced templating.

link-demo

The severity property defines the variant of a button.

severity-demo

Raised buttons display a shadow to indicate elevation.

raised-demo

Rounded buttons have a circular border radius.

rounded-demo

Text buttons are displayed as textual elements.

text-demo

Text buttons can be displayed elevated with the raised option.

raisedtext-demo

Outlined buttons display a border without a background initially.

outlined-demo

Set the iconOnly prop to render the button as a square icon button without a label slot.

icononly-demo

Badge component can be used to display a badge inside a button. OverlayBadge is used to display a badge on a button.

badge-demo

Multiple buttons are grouped when wrapped inside an element with ButtonGroup component.

buttongroup-demo

Button provides small and large sizes as alternatives to the base.

sizes-demo

When disabled is present, the element cannot be used.

disabled-demo

Custom content inside a button is defined as children.

template-demo

Screen Reader

Button component renders a native button element that implicitly includes any passed prop. Text to describe the button is defined with the aria-label prop. If the button is icon only or custom templating is used, it is recommended to use aria-label so that screen readers would be able to read the element properly.

Keyboard Support

KeyFunction
tabMoves focus to the button.
enterActivates the button.
spaceActivates the button.
Theme Designer