Skip to content

RadioGroup

  • Layer: Component
  • Base: @ark-ui/solid/radio-groupRadioGroupRoot + RadioGroupItem + RadioGroupItemControl + RadioGroupItemHiddenInput + RadioGroupItemText

Backend picker

Selected: ollama

Three items

import { RadioGroup } from "@risingswamp/design-system";
<RadioGroup.Root value={value()} onValueChange={(d) => setValue(d.value)}>
<RadioGroup.Item value="a">Option A</RadioGroup.Item>
<RadioGroup.Item value="b">Option B</RadioGroup.Item>
</RadioGroup.Root>;

RadioGroup.Item is monolithic — it internally renders the hidden native input, the visual circle control, and the label text. Callers only provide value + children.

Extends RadioGroupRootProps from @ark-ui/solid/radio-group.

PropTypeDefaultDescription
valuestringControlled selected value
defaultValuestringUncontrolled initial value
onValueChange(details: { value: string }) => voidCalled when selection changes
disabledbooleanfalseDisables all items
classstringExtra class on the root <div>
PropTypeDefaultDescription
valuestringrequiredThe value this item represents
disabledbooleanfalseDisables this specific item
childrenJSX.ElementrequiredLabel text rendered next to the circle
classstringExtra class on the item <label>
TokenUsage
borderCircle border in unselected state
accent.defaultCircle border + inner dot in selected state
{shadows.focus}Focus ring on keyboard navigation
text.secondaryLabel colour
fgLabel colour on hover
  • Renders a native hidden <input type="radio"> inside each item via RadioGroupItemHiddenInput for full keyboard + screen reader support.
  • Arrow keys move between options; Space selects.
  • Focus ring appears on :focus-visible only (not on click).
  • aria-checked state is managed by the Ark UI primitive.