# Disabled

> Disabled off and disabled on states.

A shadcn/ui block from the [@flx](https://ui.flexnative.com) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/flx/switch-05).

- Page, with a live preview: https://shadcn.exchange/r/flx/switch-05
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/flx/switch-05-light-c886914588bd13bc.png
- Registry item: https://ui.flexnative.com/r/switch-05.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://ui.flexnative.com/r/switch-05.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `switch`, `field`

## Files

### `registry/patterns/switch/switch-05.tsx`

```tsx
import { Field, FieldLabel } from '@/components/ui/field'
import { Switch } from '@/components/ui/switch'

export function Switch05() {
  return (
    <div className="flex w-full max-w-sm flex-col gap-4">
      <Field orientation="horizontal" data-disabled>
        <FieldLabel htmlFor="switch-05-off">Disabled off</FieldLabel>
        <Switch id="switch-05-off" disabled />
      </Field>
      <Field orientation="horizontal" data-disabled>
        <FieldLabel htmlFor="switch-05-on">Disabled on</FieldLabel>
        <Switch id="switch-05-on" disabled defaultChecked />
      </Field>
    </div>
  )
}
```
