# Shadcn Permissions

> Permission settings with checkboxes

- Type: example, free and open source (MIT)
- Component: [Field](https://reui.io/components/field.md)
- Page: https://reui.io/components/field/c-field-8
- Docs (Base UI): https://ui.shadcn.com/docs/components/base/field.md
- Docs (Radix UI): https://ui.shadcn.com/docs/components/radix/field.md
- MCP: `get_example("c-field-8")`
- Registry item: https://reui.io/r/styles/base-nova/c-field-8.json
- Uses: Checkbox, Field

## Best for

Role access levels from read to admin as ticked rows, with the owner only level disabled and a hint under the legend

## Agent notes

- Write claims to require Read, yet clearing `perm-read` leaves `perm-write` ticked; enforce the dependency in your handler

## Install

```bash
npx shadcn@latest add @reui/c-field-8
```

## About Shadcn Field

### When to use

- Labeled inputs, selects, text areas and code entry with optional hint text under the control
- Preference and permission lists where every switch or checkbox has a title and a description
- Validation states with a red label and one error, or a list of them, under the control

### When not to use

- A complete page for entering or editing a record, such as an invoice or a profile: use the [Form blocks](https://reui.io/blocks/application/form.md)
- A full page of toggle rows for alert channels, app integrations or workspace options: use the [Settings blocks](https://reui.io/blocks/application/settings.md)
- A numeric value stepped with plus and minus buttons or scrubbed by dragging: use [Number Field](https://reui.io/components/number-field.md) (`get_component("number-field")`)

### Agent notes

- `FieldTitle` is a plain div, so a `Checkbox` or `Switch` titled only by it has no accessible name; point a `FieldLabel` at its id instead
- `data-invalid` on `Field` only sets a red text color, which its label inherits; the control turns red from aria-invalid, which no example sets
- Nothing ties `FieldDescription` or `FieldError` to the control; give them ids and list those in the control's aria-describedby

Every ReUI item has a twin like this one; the index is https://reui.io/llms.txt. Agents with the ReUI MCP (https://reui.io/docs/mcp) get the same guidance from the getters named above.
