Switch
Example
import { Label, Switch } from "@databricks/appkit-ui/react"
export default function SwitchExample() {
return (
<div className="flex items-center space-x-2">
<Switch id="airplane-mode" />
<Label htmlFor="airplane-mode">Airplane Mode</Label>
</div>
)
}
Switch
Source: packages/appkit-ui/src/react/ui/switch.tsx
Props
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
checked | boolean | - | - | |
defaultChecked | boolean | - | - | |
required | boolean | - | - | |
onCheckedChange | ((checked: boolean) => void) | - | - | |
asChild | boolean | - | - |
Usage
import { Switch } from '@databricks/appkit-ui';
<Switch /* props */ />