Switch 1

PreviousNext

A basic switch component with label for simple on/off controls

Docs
shadcn-studiocomponent

Preview

Loading preview…
registry/new-york/components/switch/switch-01.tsx
import { Label } from '@/registry/new-york/ui/label'
import { Switch } from '@/registry/new-york/ui/switch'

const SwitchDemo = () => {
  return (
    <div className='flex items-center space-x-2'>
      <Switch id='airplane-mode' />
      <Label htmlFor='airplane-mode'>Airplane Mode</Label>
    </div>
  )
}

export default SwitchDemo

Installation

npx shadcn@latest add @shadcn-studio/switch-01

Usage

import { Switch01 } from "@/components/switch-01"
<Switch01 />