# RadioGroup

> One choice from a short, visible list (Radix RadioGroup): 16px rings in `primary`, 10px dot.

## Facts

- **Product**: Max
- **Family**: Forms
- **Global**: `window.DigitalCrew.RadioGroup`
- **Source**: `max-agent: src/components/ui/radio-group.tsx`
- **Import in the app**: `import { RadioGroup } from "@/components/ui/radio-group";`
- **Live preview**: /design/components/radio-group/preview.html
- **Page**: /design/components/radio-group

## Guidelines

**Use it for** 2–5 mutually exclusive options that need a description each ("Review every draft" / "Send replies automatically" / "Off"). More options, or options without descriptions, go in a [**Select**](/design/components/select.md).

**What you provide**: `defaultValue` or `value`/`onValueChange`; for each option a `RadioGroupItem` with `value` and `id`, a [`Label`](/design/components/label.md), and a one-line description in `muted-foreground`. Order options from safest to boldest.

## API

```ts
declare function RadioGroup({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Root>): any;
declare function RadioGroupItem({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>): any;
export { RadioGroup, RadioGroupItem };
```

## Example

```html
<div id="root" class="p-6"></div>
<script>
(function () {
  var h = React.createElement, DC = window.DigitalCrew, I = DC.Icons;
function Opt(v, title, desc) {
  return h("div", { className: "flex items-start gap-3" },
    h(DC.RadioGroupItem, { value: v, id: "rg-" + v, className: "mt-0.5" }),
    h("div", { className: "grid gap-1" },
      h(DC.Label, { htmlFor: "rg-" + v }, title),
      h("p", { className: "text-sm text-muted-foreground" }, desc)));
}
function App() {
  return h(DC.RadioGroup, { defaultValue: "review", className: "gap-4" },
    Opt("review", "Review every draft", "Max writes; nothing sends until you approve it."),
    Opt("auto", "Send replies automatically", "Inbox Autopilot answers warm replies on its own."),
    Opt("off", "Off", "Max stays out of this inbox."));
}
  ReactDOM.createRoot(document.getElementById("root")).render(h(DC.TooltipProvider, { delayDuration: 80 }, h(App)));
})();
</script>
```

## More in Forms

- [Calendar](/design/components/calendar.md): A month grid (react-day-picker 10) in the app's tokens: today and the selection in `primary`, outside days muted.
- [Checkbox](/design/components/checkbox.md): A 16px square check for independent on/off choices and row selection; the box fills in 150ms, then the tick draws in over 350ms (`.t-check`).
- [DateTimePicker](/design/components/date-time-picker.md): A date-and-time field in the app's own widget, instead of the browser's `datetime-local`; works in ISO strings.
- [Form](/design/components/form.md): Form fields wired to react-hook-form: each field gets a label, a control, an optional hint and an error message, with ids and ARIA linked for you.
- [Input](/design/components/input.md): The single-line text field: 36px tall, `input` border, `radius-md`, transparent over its ground (dark themes fill it with `input` at 30%).
- [Label](/design/components/label.md): The accessible field label (Radix Label): 14px medium, `leading-none`, 8px gap for an inline icon or `HelpTooltip`.
- [PhoneInput](/design/components/phone-input.md): An international phone field: `react-phone-number-input` with Max's `Input` and a searchable country picker that shows flags.
- [SecretInput](/design/components/secret-input.md): A field for API keys and tokens: masked by default with a reveal toggle, monospace, opted out of autofill.
- [Select](/design/components/select.md): A native-feeling single choice from a list (Radix Select): 36px trigger (`size="sm"`: 32px) with a chevron; the list opens in 250ms from 97% (`.t-dropdown`).
- [Slider](/design/components/slider.md): A Radix slider for picking a number, or a range with two thumbs, on a continuous scale.
- [Switch](/design/components/switch.md): The on/off control for settings that apply immediately (Radix Switch): a 32 × 18px pill, `input` track off, `primary` on, 16px thumb with a double-bounce (`.t-toggle`, 350ms thumb, 150ms track).
- [Textarea](/design/components/textarea.md): The multi-line field; it grows with its content (`field-sizing: content`) from a 64px minimum.
- [TimezoneSelector](/design/components/timezone-selector.md): A searchable combobox (a `Popover` holding a `Command` list) over every IANA time zone the browser knows.
- [TypedOptionPicker](/design/components/typed-option-picker.md): A searchable, grouped picker for long option lists (Popover + Command), in single and multi versions.
