Repository navigation
Description
Problem Statement
The radio family has no standalone control. RadioList + RadioListItem cover the grouped-field case, but RadioListItem reads RadioListContext and throws if rendered outside a RadioList:
RadioListItem must be used within an RadioList
So there is no way to render a single radio in a bespoke layout — a comparison cell, a pricing card header, a custom two-column arrangement — without standing up a whole RadioList (its Field chrome, label, status, group semantics). The checkbox family already solved this: CheckboxInput is the standalone labeled control, and CheckboxList / CheckboxListItem compose it. The radio family is missing that bottom layer.
This RFC specifies that missing primitive and, importantly, asks the maintainers to settle its shape and name before the implementation lands — the current draft PR (#4724) added it as RadioControl but diverges from sibling conventions (name/checked/optional-label/keepFocusableWhenDisabled), which a review correctly flagged. The convergence work is straightforward; the design questions below are not, and they are what this issue is for.
Evidence of Demand
Product-neutral cases where a radio must render outside a RadioList field:
- Pricing cards: each plan card is a large selectable surface with a radio in the corner; the cards are laid out in a
Grid, not a verticalRadioList. - Comparison tables: a radio per column header to pick "the active plan," inside
Tablecells. - Segmented custom layouts: a radio embedded in a bespoke row that already owns its own label, description, and end content.
- Settings rows composed from
Item/ListItemwhere the row — not aRadioList— owns the layout.
In every case the consumer wants the control, not RadioList's field wrapper. Today they either misuse RadioListItem (throws) or hand-roll a native <input type="radio"> (loses theming, the astryx-radio targets, focus ring, forced-colors handling, and hover treatment).
Why Existing Components Don't Cover This
RadioListis the group field (label + status +Fieldchrome + roving-tabindex management). It is the wrong layer for a single control in a custom surface.RadioListItemis a row (start content + label + description + end content) and hard-requiresRadioListContext.- There is no
RadioInputanalogous toCheckboxInput.
Prior Art (internal + external)
- In-system sibling:
CheckboxInput— the standalone labeled boolean control.CheckboxListItemcomposes it withisLabelHiddenand delegates row clicks viaItem/ListIteminteractiveRef. This is the pattern the radio family should mirror. - External: Radix
RadioGroup.Item, React AriaRadio, MUIRadio, AntRadio— all expose a single radio control that must live inside a group/provider for selection semantics. None expose a truly standalone single radio that toggles on and off, because a lone radio can't be deselected by clicking it (native behavior). That constraint is central to the shape question below.
Use Cases the API Must Handle
| # | Case | Scenario |
|---|---|---|
| 1 | Simple/default | One radio in a custom layout, controlled, with an accessible name. |
| 2 | Configured | size, isDisabled, isRequired, a disabled-reason. |
| 3 | Controlled group | Several controls sharing a group name, one selected, selecting one deselects the rest. |
| 4 | Composed | A radio inside a Card / Table cell / bespoke Item row that owns the visible label. |
| 5 | Edge | Disabled-with-reason must stay keyboard- and AT-discoverable; forced-colors; RTL. |
| 6 | Migration | RadioListItem recomposed on top of the primitive with no behavior change for existing RadioList consumers. |
Candidate API Shapes (arbitration)
Option A — bare RadioControl (control only)
Renders just the circle + dot; the accessible name is required and applied as aria-label; no visible label text.
<RadioControl
label="Pro" // required — accessible name (aria-label)
htmlName="plan" // optional; generated fallback for grouping
value="pro"
isChecked={value === 'pro'}
onChange={(v, e) => setValue(v)}
/>- Converges naming to siblings:
htmlName?,isChecked,labelrequired,onChange(value, e). - Disabled-reason via
disabledMessage?(mirrorsCheckboxInput), replacing the internalkeepFocusableWhenDisabledboolean. - Pro: smallest surface; a true low-level primitive. Con:
labelrenders nothing visible, so "labelled" means "aria-label only" — a subtle mismatch withCheckboxInput, wherelabelis visible unlessisLabelHidden.
Option B — full RadioInput (the CheckboxInput twin)
A fully labeled control: circle + visible label + description + status + disabledMessage, isLabelHidden to hide the label. RadioListItem composes it exactly as CheckboxListItem composes CheckboxInput (hidden label + row click delegation).
<RadioInput
label="Pro"
description="Everything in Basic, plus…"
htmlName="plan"
value="pro"
isChecked={value === 'pro'}
onChange={(v, e) => setValue(v)}
/>- Pro: perfect family symmetry;
label/isLabelHidden/description/status/disabledMessageall mean exactly what they mean onCheckboxInput; resolves the "same word, opposite behavior" objection cleanly. - Con: larger surface; and recomposing
RadioListItemon it changesRadioListItem's rendered output (drops the external<label htmlFor>in favor of a hidden label on the control + click delegation). That's a deliberate, reviewable change, not a byte-identical refactor.
Option C — relax RadioListItem's throw (no new export)
Give RadioListItem a standalone mode (like CheckboxListItem's isChecked/onCheck) so it renders outside a RadioList instead of throwing. No new component.
<RadioListItem label="Pro" value="pro" isChecked={value === 'pro'} onCheck={() => setValue('pro')} />- Pro: zero new public component; smallest API-surface delta. Con:
RadioListItemis a row abstraction — it still carries row layout you may not want in aCard/cell; and it doesn't give you the bare control.
Recommendation
Lead with Option B (RadioInput) — it is the most convergent with the existing checkbox family and makes every shared prop mean the same thing across the two families, which is the strongest signal from the review. Fall back to Option A if the maintainers prefer to keep the primitive bare and not expand RadioListItem's output. Option C is viable only if the team decides a standalone bare control isn't wanted at all.
This should be vibe-tested per [API Arbitration] with naive prompts across use cases 1–6 (single radio in a card; a controlled group; a radio in a table cell; disabled-with-reason) before the shape is locked. I'm happy to run that and post results here.
Convergence Requirements (apply to whichever shape wins)
A prior review of the draft PR enumerated fixes that any final shape must satisfy:
- Naming →
htmlName?(notname),isChecked(notchecked), requiredlabel(+isLabelHiddenfor Options B),disabledMessage?(notkeepFocusableWhenDisabled). Noeslint-disableon@astryx/boolean-prop-naming. - Always has an accessible name —
labelrequired so a standalone control can't ship unnamed. xstyle/className/styleland on the root wrapper, not the zero-opacity<input>.radioScopeon the control's own wrapper so a standalone control has a hover state (today it only hovers inside aRadioListItemrow).- New public surface → spec'd + vibe-tested + maintainer sign-off (this issue).
- Focus ring on the disabled-with-reason path (
!isDisabled || keepsFocusable). {...rest}precedence — contract props (type,role, computedid,aria-*) set after{...rest}; owned handlers composed viacomposeEventHandlers, not clobbered.onChange(value, e)— hand back the event (matchesCheckboxInput).- Docs — a
themingblock forastryx-radio/astryx-radio-dotdiscoverable from the component's own doc, tokens for the raw dimensions, andaria-describedbydocumented only where actually supported.
Tracking
Implementation lands in PR #4724 once the shape is settled here. Author: freddymeta.
Activity
freddymeta commentedon Aug 6, 2026
API Arbitration — vibe test results (A vs B vs C)
Ran the arbitration from the spec: three isolated blank-slate agents, each given only its option's skill doc (no knowledge of the others, no other design system), building the same 5 naive UX prompts (prompts describe UX, never name props). Prompts: (P1) plan-picker cards, (P2) labeled single-select group, (P3) selectable indicator in table headers, (P4) locked row with a why-disabled explanation, (P5) a single on/off circular control.
Per-prompt outcome
RadioControl(bare)RadioInput(CheckboxInput twin)RadioListItemstandalone<label>wrapper made the card clickablelabelcompeted with the card's own text — needsisLabelHidden(agent didn't reach for it)styleon the row root; agent flagged risk of fighting the item's internal padding/indicator layoutlabel+descriptionmapped 1:1label+descriptionmapped 1:1aria-label, cleanisLabelHidden— agent found it and used it cleanlyisDisabled+disabledMessage, two props<div title>that doesn't show on keyboard focus (requirement not met)Cross-cutting findings (all three)
orientation/direction — for P2 all three hand-rolled<fieldset>/<legend>for the group's accessible name. That points at a separate gap:RadioListisn't discoverable as the grouping primitive from a control-level doc (and there's no lightweightRadioGroup). Not blocking this decision, but worth a follow-up.Card/selection concern, not a radio concern — no radio primitive should own card chrome; all three correctly reached for their own layout. (This is theSelectableCardcomposition space.)Read
disabledMessageonSelector/CheckboxInput/RadioList), and standaloneRadioListItemcan't express it without wrapping back in aRadioList. Cramming a full row into a header cell (P3) is also awkward. Standalone mode on a row abstraction is the wrong layer.isLabelHiddenneutralizes A's only edge (the P3 agent proved this), it wins the common labeled case (P2) and the disabled case (P4) outright, and it's family-symmetric withCheckboxInput— every shared prop (label/isLabelHidden/description/status/disabledMessage/isChecked) means the same thing across the checkbox and radio families.Recommendation (unchanged, now data-backed): Option B —
RadioInputRadioInputas the labeled control mirroringCheckboxInput, withRadioListItemcomposing it the wayCheckboxListItemcomposesCheckboxInput(hidden label on the control + row-click delegation).isLabelHiddencovers the bespoke-surface cases A seemed to win.The one tradeoff to sign off on: recomposing
RadioListItemonRadioInputchangesRadioListItem's rendered output (hidden-label-on-control + click delegation instead of today's external<label htmlFor>). That's a deliberate, reviewable change — and it makes the radio family structurally identical to the checkbox family, which is the point.If maintainers prefer the absolute-minimal primitive over family symmetry, A is the clean fallback. Either way, C is out.
Happy to proceed on whichever of A/B you pick; I'll hold the #4724 implementation until then.
freddymeta commentedon Aug 6, 2026
Revised recommendation: Option A —
RadioControl(correcting my earlier lean toward B)Reconsidering the arbitration, I was optimizing for name-symmetry with
CheckboxInputand under-weighted a naming-taxonomy fact that points the other way:In Astryx,
*Inputnames a labeled form field, not a bare control.TextInput,NumberInput,DateInput,FileInput,CheckboxInputare allField-based, and each has a natural standalone use — a singleCheckboxInput("Accept terms") is a valid field on its own.A radio has no standalone-field use. A lone radio is an anti-pattern — it can't be deselected (all three options' P5 in the vibe test correctly refused to ship one). So
RadioInputwould name a standalone labeled radio field that has no valid standalone case. That's the "strange" — the concept doesn't transfer.The thing the radio family is actually missing is the bare control (the circle) as a composition primitive for custom surfaces (cards, table cells, bespoke rows). Note the checkbox family doesn't export its bare control at all — it's internal to
CheckboxInput. So B's "family symmetry" was matching the name of a different layer (a field), not a true sibling.RadioControlnames the primitive honestly. And it resolves the "label renders nothing visible" objection rather than dodging it: for a control primitive,label → aria-labelis the documented icon-only-Buttonconvention (API Conventions → Accessibility: "Icon-only buttons:labelused asaria-labelwhen no visible text"). So a requiredlabelapplied as the accessible name is convention-aligned for a control — not the "same word, opposite behavior" divergence it would be for a field.What ships (Option A, convergence applied)
RadioControl— the bare control.labelrequired →aria-label(icon-only-Button convention; fixes "can ship unnamed").htmlName?,isChecked,value,onChange(value, e),size?,isDisabled?,isRequired?,disabledMessage?. Noeslint-disable.RadioListItemkeeps composing it, behavior stable (its visible label still names + toggles the radio; the control isn't double-named). 44 existing tests stay green.xstyle/className/styleon the root wrapper,radioScopeon the control's own wrapper (standalone hover), focus ring on the disabled-with-reason path,{...rest}precedence +composeEventHandlers, doctheming/tokens/aria-describedby.The vibe data still supports this
A and B were close and split by layer; C was eliminated (fails disabled-with-reason). Between A and B, A is the honest primitive and B mis-names a field. The one thing B "won" — the labeled cases — is served by
RadioListItem(the labeled row) composingRadioControl, which is the existing composition. So: bareRadioControlprimitive +RadioListItemfor the labeled/grouped case, noRadioInput.Maintainers: still your call on whether the primitive should exist and land in
core(contributor API gate). But if it does, the shape isRadioControl, notRadioInput. Proceeding to apply the convergence on this shape.freddymeta commentedon Aug 6, 2026
Shape decision: A — bare
RadioControl(settled)After further discussion, the shape settled on Option A — the bare control (
RadioControl), not Option B (RadioInput).The reasoning is simple and correct:
*Inputin Astryx is always a labeled form field (CheckboxInput,TextInput,NumberInput,DateInput). A lone radio has no valid standalone-field use case — you never need a full field wrapper (label + description + status chrome) around a single radio sitting in a card corner or table header. The missing piece was always the composition primitive (the circle), which is whatRadioControlis.RadioListItemcomposes it the same way as before.The
*Inputname would be structurally misleading — it implies field-level chrome that doesn't exist here.Implementation is pushed (
b961e2f9eon #4724) with all convergence requirements from the review addressed:htmlName?/isChecked/onChange(value, e)/disabledMessage(no eslint-disable)label→aria-label(icon-only-Button convention — the control has no visible text)xstyle/className/styleon the root wrapperradioScopeon own wrapper (standalone hover works){...rest}before contract propshtmlNameis omittedRadioListItemcomposes unchanged (adapts(value, e)→ value-only onChange)astryx-radio/astryx-radio-dot)htmlName, no lone-toggle anti-pattern332 tests pass (11 RadioControl + 44 RadioList + 277 themingTargets). Typecheck/lint/check:sync/changeset green.
Awaiting maintainer API-surface sign-off on the converged shape.
cixzhang commentedon Nov 18, 2026
(Posted by Cindy's agent.) Thank you for the use cases and your patience, @freddymeta, and sorry for the long wait. You're right that no record covers a standalone radio today:
RadioListItemonly works inside aRadioList, unlike the checkbox family'sCheckboxInput. Adding one is a new public component, so it's now in the owners' decision queue. We'll update this issue when it's decided.