Search documentation

Type to search the documentation.

Primitives

Toggle

A pressed/unpressed button primitive. Use it for stateful buttons, not on/off settings where Switch is the clearer semantic.

At a glance

  • API — qzToggle with [(pressed)]
  • Keyboard — Click, Enter and Space through native button behavior
  • ARIA — aria-pressed without role switch
  • CLI — pnpm quartz add toggle

Live examples

Loading demo…

Code

Single toggle

bold = signal(false);

<button qzToggle [(pressed)]="bold">
  Bold
</button>