Radio groupPro
Pick one: a list, cards or an inline row, with descriptions and options that are disabled with a reason.
oxyn add radio-groupThe preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.
Rendered from Rust at build time · goes live when visible
When to use
- Pick one: a list, cards or an inline row, with descriptions and options that are disabled with a reason.
When not to use
- Switch between two to six options: use Segmented Control instead.
- How much the agent may do without asking: use Permission selector instead.
- On or off for things that apply right away: use Switch instead.
Installation
Radio group is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.
oxyn add radio-groupUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
List
Stacked with descriptions.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Cards
Each option is a card.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Inline
One row.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Segmented
A segmented tray with one gliding pill (Oxyn plus).
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
RadioGroup
| Prop | Type | Default | Description |
|---|---|---|---|
labelrequired | String | — | Group label. |
optionsrequired | Vec<RadioOption> | — | Options. |
value | Option<String> | Default::default() | Selected value. |
layout | String | "list" | `list` · `cards` · `inline` · `segmented`. |
name | Option<String> | Default::default() | Native radio name for form submission (a hidden input carries the value). |
on_change | EventHandler<String> | — | Changed. |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| ↑or↓ or ←or→ | Move and select (skips disabled options) |
| Tab | Into the group lands on the selected option |
Accessibility
- role=radiogroup with a label; one tab stop with roving focus.
- Disabled options stay readable and say why ("Your admin turned this off").
Responsive behaviour
- list and cards stack vertically; inline puts the options in one row for short labels.
Notes for AI
- Import
RadioGroupfromoxyn_dioxusand includePRIMITIVES_CSSplus the token stylesheet once. - A GPUI version exists:
RadioGroupElinoxyn_gpui. - Props to set first:
label,options. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.