Switch 19

PreviousNext

Animated motion switches in multiple sizes with smooth transition effects

Docs
shadcn-studiocomponent

Preview

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

const SwitchAnimatedDemo = () => {
  return (
    <div className='flex flex-col gap-3'>
      <div className='flex items-center space-x-2'>
        <Switch aria-label='Animated small switch' size='sm' id='small-switch' />
        <Label htmlFor='small-switch'>Small switch</Label>
      </div>
      <div className='flex items-center space-x-2'>
        <Switch aria-label='Animated medium switch' size='md' id='medium-switch' />
        <Label htmlFor='medium-switch'>Medium switch</Label>
      </div>
      <div className='flex items-center space-x-2'>
        <Switch aria-label='Animated large switch' size='lg' id='large-switch' />
        <Label htmlFor='large-switch'>Large switch</Label>
      </div>
    </div>
  )
}

export default SwitchAnimatedDemo

Installation

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

Usage

import { Switch19 } from "@/components/switch-19"
<Switch19 />