Skip to content

Switch

InputMIT
View in Storybook

Toggle switch for boolean settings with smooth animation.

bun add @otfdashkit/ui

Preview

Switch
Loading Storybook preview…

Code

import { Switch } from '@otfdashkit/ui'

export function Example() {
  return (
    <div className="flex flex-col gap-3">
      <div className="flex items-center gap-2">
        <Switch id="airplane" />
        <label htmlFor="airplane" className="text-sm font-medium">Airplane Mode</label>
      </div>
      <div className="flex items-center gap-2">
        <Switch id="on" defaultChecked />
        <label htmlFor="on" className="text-sm font-medium">Enabled by default</label>
      </div>
    </div>
  )
}

Free with the SDK. This component ships in @otfdashkit/ui under the MIT license.