zynactradocs

Toggle

A button that stays pressed. For formatting and view options, not settings.

Usage

import { Toggle } from "@zynactra/ui/toggle"
<Toggle aria-label="Bold">
  <BoldIcon />
</Toggle>

Variants are default and outline; sizes sm, default and lg. Control it with pressed and onPressedChange.

Guidelines

  • For a setting that persists (notifications on or off), use Switch.
  • Icon-only toggles need aria-label, and a Tooltip if the icon isn't obvious.
  • The pressed state uses the accent surface, never brand.

API reference

Behaviour and props come from Base UI. See the Base UI Toggle docs.

Edit on GitHub

On this page