Skip to main content

Common Examples

The Button component can be used in the same way that you would use an HTML button element, while the ButtonLink component can be used in the same way that you would use an HTML a element.

Form Submit

The type prop can be used to alter the default functionality of the button. A common use case is to use type="submit" in order to submit the content of a form.
In general, Links should be used for navigating to other pages or website. To create a link that is styled like a button, use the ButtonLink component.

Using button compounds to make components interactive

To add interactivity to components that are usually static, such as avatars, use the ButtonCompound component.

Interactive cards

To make cards clickable, use the InteractiveCard component. It supports nested interactive elements without accessibility violations.

AI Mark

Use the aiMark prop to display an AI indicator. aiMark accepts a boolean, or one of:
  • "mark"
  • "chat"
  • "edit"
  • "form"
  • "mic"
  • "search"
The aiMark prop cannot be used together with a before icon (a single icon Svg or icon={{ before: Svg }}).With children:
Icon-only AI:

Minimum width for buttons

If a Button component has any children, it will have a 5rem minimum width. This is not applied in icon-only buttons using the icon prop. In some cases, such as when adding a Badge as a child of a Button component without any text, this can lead to unexpected width changes.Either override the width and minWidth of the Button component, or make the Badge a sibling of the Button inside of a div with relative positioning.

React Accessibility

Icon-only buttons

Do
Use aria-label or aria-labelledby for a button without any text.
Don’t
Provide only an icon for screen readers to read.For more guidance on button labels and accessibility, see button accessibility best practices.
Last modified on April 14, 2026