Forms

Switch

Binary toggle for settings.

Primitive

@radix-ui/react-switch

Switch

Binary toggle.

API Reference

PropTypeDefaultDescription
checkedboolean--Controlled checked state.
defaultCheckedboolean--Default checked for uncontrolled usage.
onCheckedChange(checked: boolean) => void--Called when state changes.
disabledbooleanfalseDisable the switch.

Usage

import { Switch } from "@doss/tetris-ui";