Skip to content

[role="button"] ​

Any element with role="button" is rendered as a button.

This is useful when a non-button element (e.g. <div>, <span>) needs to behave and look like a button.

This role can also be applied to <details> elements to create Accordion buttons and Dropdown buttons.

Basic Usage ​

live preview
editable html
<div role="button">
  &lt;div&gt; as button
</div>

Variants ​

Intent Variants ​

To convey intent and importance, buttons can be styled with different variants. The default variant is .primary, which is used for the most important actions on a page, but there are also:

live preview
See code

Modifiers ​

.ghost creates transparent background buttons with colored text and borders, useful for secondary actions where you want minimal visual weight.

live preview
See code

.subtle creates buttons with a more muted appearance, often used for less prominent actions.

live preview
See code