Components / Switch

Switch

A standing binary setting: auto-post, notifications. Use Checkbox when the choice is one of several fields submitted together.

import { Switch } from '@layers/ui/switch'

Rendered stock

House rules

  • Pair every Switch with a Label wired via htmlFor.
  • Two sizes via the size prop: default and sm.
  • Flipping a switch is a mutation like any other: no optimistic saves; persist through an explicit Save button with a spinner.