# Compact settings table with switches

> Compact settings table with switches

A shadcn/ui block from the [@reui](https://reui.io) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/reui/c-switch-13).

- Page, with a live preview: https://shadcn.exchange/r/reui/c-switch-13
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/reui/c-switch-13-light-f3cfc81b0f11b723.png
- Registry item: https://reui.io/r/new-york-v4/c-switch-13.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://reui.io/r/new-york-v4/c-switch-13.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: `separator`, `switch`

## Files

### `c-switch-13.tsx`

```tsx
import { Separator } from "@/components/ui/separator"
import { Switch } from "@/components/ui/switch"

const settings = [
  {
    id: "auto-save",
    label: "Auto-save",
    description: "Save changes automatically",
    checked: true,
  },
  {
    id: "spell-check",
    label: "Spell check",
    description: "Highlight spelling errors",
    checked: true,
  },
  {
    id: "line-numbers",
    label: "Line numbers",
    description: "Show line numbers in editor",
    checked: false,
  },
]

export function Pattern() {
  return (
    <div className="mx-auto w-full max-w-xs">
      <p className="mb-3 text-sm font-medium">Editor Preferences</p>
      <Separator />
      <div className="flex flex-col">
        {settings.map((setting) => (
          <label
            key={setting.id}
            htmlFor={setting.id}
            className="flex cursor-pointer items-center justify-between border-b py-3 last:border-b-0"
          >
            <div className="flex flex-col gap-0.5">
              <span className="text-sm font-medium">{setting.label}</span>
              <span className="text-muted-foreground text-xs">
                {setting.description}
              </span>
            </div>
            <Switch
              id={setting.id}
              defaultChecked={setting.checked}
              size="sm"
            />
          </label>
        ))}
      </div>
    </div>
  )
}
```
