Skip to content

Button Library · Interactive

Toggle

Stays on or off, tells screen readers which.

States

  • Default

  • Hover

  • Active

  • Focus

Code

toggle.html

<button class="btn-toggle" type="button" aria-pressed="false">
  <svg class="btn-toggle__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
    <path d="m12 4 2.5 5.2 5.7.8-4.1 4 1 5.7L12 17.2 6.9 19.7l1-5.7-4.1-4 5.7-.8Z"></path>
  </svg>
  <span>Follow</span>
</button>

More in Interactive