Components
Theme, language, and motion switches
Three small controls that every Origin Labs header carries.
Theme toggle#
Both icons are in the markup. CSS shows the sun in dark theme (the action is "switch to light") and the moon in light theme. The theme behavior keeps the aria-label in sync.
<button type="button" class="ha-icon-button ha-theme-toggle" data-ha-theme-toggle aria-label="Switch theme">
<span class="ha-theme-toggle__sun"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/></svg></span>
<span class="ha-theme-toggle__moon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"/></svg></span>
</button>This toggle is live: it changes the theme of this page.
Segmented switch#
A pill of options for languages or brands. The active option uses the primary fill. Use aria-pressed for toggle semantics, or aria-current="true" for a language list.
<div class="ha-segmented" role="group" aria-label="Language">
<button type="button" class="ha-segmented__item" aria-pressed="true" lang="en">EN</button>
<button type="button" class="ha-segmented__item" aria-pressed="false" lang="pt-BR">PT</button>
<button type="button" class="ha-segmented__item" aria-pressed="false" lang="es">ES</button>
</div>
<div class="ha-segmented ha-segmented--sans" role="group" aria-label="Brand">
<button type="button" class="ha-segmented__item" aria-pressed="true">Origin</button>
<button type="button" class="ha-segmented__item" aria-pressed="false">Gabarito</button>
</div>The mono variant suits short codes. The sans variant suits words.
Pause-motion switch#
A visible control for auto-moving content. It sets data-motion="off" on the root, which the CSS and every behavior respect. The label stays the same and aria-pressed="true" means paused.
<button type="button" class="ha-motion-toggle" data-ha-motion-toggle aria-pressed="false">
<span class="ha-motion-toggle__pause"><svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true" focusable="false"><rect x="6" y="5" width="4" height="14" rx="1"/><rect x="14" y="5" width="4" height="14" rx="1"/></svg></span>
<span class="ha-motion-toggle__play"><svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true" focusable="false"><path d="M8 5v14l11-7z"/></svg></span>
Pause animations
</button>Live. It is also in the footer of this page.
Accessibility#
- All three are real buttons with visible focus and 40px targets, 44px on phones.
- The theme toggle label names the action, not the state.
- Active segmented items are marked by
aria-pressedas well as color.