# Field with radio groups and checkboxes

> Field with radio groups and checkboxes

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

- Page, with a live preview: https://shadcn.exchange/r/reui/c-field-4
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/reui/c-field-4-light-4375e98f518560ff.png
- Registry item: https://reui.io/r/new-york-v4/c-field-4.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-field-4.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: `checkbox`, `field`, `radio-group`

## Files

### `c-field-4.tsx`

```tsx
import { Checkbox } from "@/components/ui/checkbox"
import {
  Field,
  FieldContent,
  FieldDescription,
  FieldGroup,
  FieldLabel,
  FieldLegend,
  FieldSet,
  FieldTitle,
} from "@/components/ui/field"
import {
  RadioGroup,
  RadioGroupItem,
} from "@/components/ui/radio-group"

export function Pattern() {
  return (
    <div className="mx-auto w-full max-w-xs">
      <FieldGroup>
        <FieldSet>
          <FieldLegend variant="label">Email Notifications</FieldLegend>
          <FieldGroup className="gap-4">
            <Field orientation="horizontal">
              <Checkbox id="notify-updates" defaultChecked />
              <FieldContent>
                <FieldTitle>Product updates</FieldTitle>
                <FieldDescription>
                  Receive emails about new features and improvements.
                </FieldDescription>
              </FieldContent>
            </Field>
            <Field orientation="horizontal">
              <Checkbox id="notify-security" defaultChecked disabled />
              <FieldContent>
                <FieldTitle>Security alerts</FieldTitle>
                <FieldDescription>
                  Critical security notifications cannot be disabled.
                </FieldDescription>
              </FieldContent>
            </Field>
          </FieldGroup>
        </FieldSet>
        <FieldSet>
          <FieldLegend variant="label">Profile Privacy</FieldLegend>
          <RadioGroup defaultValue="public">
            <FieldGroup className="gap-2">
              <Field orientation="horizontal">
                <RadioGroupItem value="public" id="privacy-public" />
                <FieldLabel htmlFor="privacy-public" className="font-normal">
                  Public - visible to everyone
                </FieldLabel>
              </Field>
              <Field orientation="horizontal">
                <RadioGroupItem value="private" id="privacy-private" />
                <FieldLabel htmlFor="privacy-private" className="font-normal">
                  Private - only visible to you
                </FieldLabel>
              </Field>
            </FieldGroup>
          </RadioGroup>
        </FieldSet>
      </FieldGroup>
    </div>
  )
}
```
