Toggle

Displays a boolean value.

Default

Disabled

Sizes

Custom Color

With Label

Best Practices

  • Use Toggle for a single boolean setting where ON takes effect immediately, like Password Protection or Auto-Cancel Builds. Switch to Checkbox for a multi-select list, or to Switch for 2–3 mutually exclusive views.
  • checked is required and the component is controlled. Own the state and update it from onChange.
  • Persist on change and surface the result in a useToasts().success(…) toast (Password protection enabled); don’t leave the user wondering whether the flip stuck. Pair with a form footer only when the setting needs an explicit Save step.
  • Disable Toggle only when the action is impossible (missing plan, locked policy); pair with helper text or a Tooltip that names the resolver.
  • The label is children, not a label prop. Title Case noun phrase, 1–4 words, naming what is true when ON: Password Protection, not Enable Password Protection.
  • Render an optional one-sentence description as a sibling under the label that explains ON only. Don’t describe OFF; it’s the negation.
  • Keep labelCasing="title" (the default) so labels match other Title Case surfaces. Use labelCasing="normal" only when sentence-case content sits inline next to the toggle.
  • Provide an accessible name through children, aria-label, or aria-labelledby. Geist warns in development if all three are missing.
  • Set aria-label only when the visible label sits elsewhere on the row; otherwise let children carry it so sighted and screen-reader copy stay aligned.