[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">
<div> 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
editable html
<section class="primary" role="button">
<section> as button
</section>
<section class="secondary" role="button">
<section> as button
</section>
<section class="contrast" role="button">
<section> as button
</section>
<section class="success" role="button">
<section> as button
</section>
<section class="info" role="button">
<section> as button
</section>
<section class="warning" role="button">
<section> as button
</section>
<section class="danger" role="button">
<section> as button
</section>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
editable html
<section class="primary ghost" role="button">
<section> as button
</section>
<section class="secondary ghost" role="button">
<section> as button
</section>
<section class="contrast ghost" role="button">
<section> as button
</section>
<section class="success ghost" role="button">
<section> as button
</section>
<section class="info ghost" role="button">
<section> as button
</section>
<section class="warning ghost" role="button">
<section> as button
</section>
<section class="danger ghost" role="button">
<section> as button
</section>.subtle creates buttons with a more muted appearance, often used for less prominent actions.
live preview
See code
editable html
<section class="primary subtle" role="button">
<section> as button
</section>
<section class="secondary subtle" role="button">
<section> as button
</section>
<section class="contrast subtle" role="button">
<section> as button
</section>
<section class="success subtle" role="button">
<section> as button
</section>
<section class="info subtle" role="button">
<section> as button
</section>
<section class="warning subtle" role="button">
<section> as button
</section>
<section class="danger subtle" role="button">
<section> as button
</section>