Skip to main content

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

PropTypeRequiredDefaultDescription
checkedboolean--
defaultCheckedboolean--
requiredboolean--
onCheckedChange((checked: boolean) => void)--
asChildboolean--

Usage

import { Switch } from '@databricks/appkit-ui';

<Switch /* props */ />