Links and buttons
Use a button for an action and a link for navigation.
1. Link in nav
Inside nav, an inactive anchor has no underline, even on hover. The current anchor below uses aria-current="page" to underline it and identify the current page; active also underlines a link. Hover changes navigation text to primary. Tab shows the primary-colored focus outline; Enter follows the destination.
<nav class="flex flex-wrap gap-16" aria-label="Example navigation">
<a href="/ui/">Inactive link in nav</a>
<a href="/ui/buttons/" aria-current="page">Current link in nav</a>
</nav>
2. Link in paragraph
This paragraph contains an anchor with class="clr-underline". The class explicitly supplies both primary color and an underline. Hover changes the color to primary-light and keeps the underline. Keyboard focus adds the primary-colored outline.
This is a Link in paragraph with primary color and an underline.
<p class="m-0">This is a <a class="clr-underline" href="/docs/colors/">Link in paragraph</a> with primary color and an underline.</p>
3. Link by itself
This plain anchor is outside both p and nav and has no classes. It starts in body text color without an underline. Here in main content, hover changes its color to primary and adds an underline. Keyboard focus adds the primary-colored outline.
<a href="/docs/installation/">Link by itself</a>
All three examples use real destinations and follow the current palette and light/dark mode.
Buttons: base and palette variants
btn provides the shape, spacing, and inherited typography. Use btn btn-primary for a solid palette fill, white text, and modest rounded corners. Use btn btn-secondary for a transparent pill with matching colored text and outline. These sample buttons demonstrate appearance and do not run an action.
<div class="flex flex-wrap gap-16 items-center">
<button class="btn" type="button">btn</button>
<button class="btn btn-primary" type="button">btn btn-primary</button>
<button class="btn btn-secondary" type="button">btn btn-secondary</button>
</div>
Primary and secondary are persistent visual variants, not selected and unselected states. Keep the same variant class when state changes. A held press (:active), aria-pressed="true", aria-selected="true", or aria-expanded="true" slightly darkens the same primary fill or adds a stronger tinted fill inside the secondary outline. Primary keeps white text and modest rounded corners. Secondary stays pill-shaped with matching text and outline: its idle background is transparent, hover adds a subtle palette tint, and selected or expanded states use a stronger tint. Use the ARIA attribute appropriate to the control: pressed for toggle buttons, selected for tabs, and expanded for disclosures.
Unavailable actions
Use the native disabled attribute for an unavailable button; it prevents activation.
<div class="flex flex-wrap gap-16 items-center">
<button class="btn btn-primary" type="button" disabled>Primary unavailable</button>
<button class="btn btn-secondary" type="button" disabled>Action unavailable</button>
</div>
Small buttons and keyboard focus
Add btn-sm for 12px text, 18px line-height, and 6px vertical / 12px horizontal padding. Size is independent of appearance: combine it with either btn-primary or btn-secondary. Without the modifier, btn keeps its inherited typography and default padding of 0.75rem 1rem. Tab through the enabled controls to see the focus outline; a native button supports Enter and Space. The disabled button is skipped in the normal Tab sequence.
<div class="flex flex-wrap gap-16 items-center">
<button class="btn btn-secondary btn-sm" type="button">Compact topic</button>
<button class="btn btn-primary btn-sm" type="button">Compact button</button>
</div>
Primary fills use the existing deeper light-mode primary accent in both modes for readable white labels. Secondary text and outlines follow the current mode’s secondary accent. Customize them through the Colors and palettes guide, then check text, borders, and focus outlines against their surroundings. A named palette pair does not guarantee accessible contrast.