Skip to content

Switch

  • Layer: Component
  • Base: @ark-ui/solid/switch + custom styling

On · off · disabled

StateVisual
Off40×22 pill, --colors-bg-muted fill, --colors-border border. Thumb sits left, --colors-text-secondary.
On--colors-accent-dim fill, --colors-accent-default border. Thumb translated 18px right, --colors-accent-default.
DisabledSame geometry, opacity: 0.4, cursor not-allowed.
Focus-visibleCyan focus ring via --shadows-focus.

No drop shadows, no glow. Selection is signified by the --colors-accent-default fill on the thumb and --colors-accent-dim background on the track.

Wraps @ark-ui/solid/switch, which manages role="switch", aria-checked (true/false), keyboard activation (Space), and a hidden native input for form submission. The DS adds the visual layer only. Pass an explicit aria-label when the switch ships without a visible label.

PropTypeDefaultDescription
checkedbooleanControlled checked state
onCheckedChange(details: { checked: boolean }) => voidChange handler
disabledbooleanfalseDisables interaction
childrenJSX.ElementOptional label, rendered to the right
aria-labelstringRequired when no visible children label.