Primary Intent
The .primary class provides a visual style for links and buttons that indicate a primary action. Use it to highlight actions that are the main focus or most important.
Links
Apply .primary to <a> elements or elements with [role="link"] to indicate a primary action.
live preview
editable html
<a href="#" class="primary">Regular Link</a>
<hr>
<a href="#" aria-current="page" class="primary">Active link</a>
<hr>
<button class="primary" role="link">
<button> as link
</button>
<hr>
<button role="link" aria-current="page" class="primary">Active button</button>
<hr>
<div class="primary" role="link">
<div> as link
</div>
<hr>
<div role="link" aria-current="page" class="primary">Active div</div>Buttons
Apply .primary to <button> elements or elements with [role="button"] for a primary action button.
live preview
editable html
<div class="auto-grid">
<button class="primary">
Button
</button>
<div class="primary" role="button">
<div> as button
</div>
<details>
<summary class="primary" role="button" aria-haspopup="menu">
Dropdown as a button
</summary>
<ul role="menu">
<li><a role="menuitem" href="#">Solid</a></li>
<li><a role="menuitem" href="#">Liquid</a></li>
<li><a role="menuitem" href="#">Gas</a></li>
<li><a role="menuitem" href="#">Plasma</a></li>
</ul>
</details>
</div>Cards
Apply .primary to an element with .card for a primary action card.
live preview
Modifiers
.primary can be modified with .subtle to create cards with a more muted appearance, often used for less prominent actions.
live preview
.primary can be modified with .ghost to create ghost buttons and cards, which have a transparent background and a border, making them less visually prominent while still maintaining the primary effect.
live preview