Skip to main content
⚠️ AppKit is in an early development phase and is subject to change without notice. DO NOT use in production environments.

# Switch

Toggle control for switching between on and off states

## 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​

Toggle control for switching between on and off states

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 */ />