Skip to content
Forms

Switch

A toggle for a boolean. Built on Base UI, with the thumb animated between states and the label wired for screen readers.

Import

import { Switch } from "@mikenotthepope/substrateui"

With Label

API Reference

PropTypeDefaultDescription
checkedbooleanfalseThe controlled checked state of the switch.
onCheckedChange(checked: boolean) => voidCallback fired when the switch is toggled.
disabledbooleanfalseWhen true, prevents interaction with the switch.