Switch

inputs

A control that allows the user to toggle between checked and not checked.

Preview

Installation

npm install @launchapp/design-system
Import
import { Switch } from "@launchapp/design-system";

Examples

Basic Switch

<div className="flex items-center space-x-2">  <Switch id="airplane-mode" />  <Label htmlFor="airplane-mode">Airplane Mode</Label></div>

Props

PropTypeDefaultDescription
checked
booleanControlled checked state.
defaultChecked
booleanfalseInitial checked state.
onCheckedChange
(checked: boolean) => voidCallback when checked state changes.
disabled
booleanfalseDisables the switch.
required
booleanMakes the switch required in forms.