Radio Group

A managed set of radios (native inputs, so arrow-key navigation comes free). Pair with RadioOptions.

Real use · billing plan

Horizontal

Using Radio Group

Silica ships one design system through three paths. They share a class vocabulary but are not interchangeable — pick the one that matches what you are building.

Plain HTML — CSS classes

The Tailwind v4 plugin. Works in any framework or none — Rails, Django, PHP, Go, a static file. This path is complete for Radio Group — it needs no JavaScript, so the classes below are the whole story.

/* in your CSS */
@import "tailwindcss";
@plugin "@wizeworks/silicaui";

Root class radio-group, with 1 modifier:

  • .radio-group
  • .radio-option

React

Typed components over those same classes, with behavior and accessibility from Base UI.

npm i @wizeworks/silicaui-react
import { RadioGroup } from "@wizeworks/silicaui-react";

Props

RadioGroupProps
PropTypeRequiredDescription
valuestringnoControlled selected value.
defaultValuestringnoUncontrolled initial value.
onValueChange(value: string) => voidnoFires with the newly-selected value.
namestringnoShared radio name (auto-generated if omitted).
orientationRadioGroupOrientationnoStack (vertical, default) or row (horizontal).
disabledbooleannoDisable every option.
colorSilicaColornoDefault accent color for the options.
sizeSilicaSizenoDefault size for the options.
RadioOptionProps
PropTypeRequiredDescription
valuestringyesThis option's value.
disabledbooleanno—
colorSilicaColorno—
sizeSilicaSizeno—

Source of the demo above

The exact file that renders the examples above, so it can never drift from them. It imports a few of this site’s own layout helpers (../lib/…), so read it for the component calls rather than copying it whole.

Show source
import { useState } from "react";
import { RadioGroup, RadioOption } from "@wizeworks/silicaui-react";
import { Section } from "../lib/Section";

export function RadioGroupDemo() {
    const [plan, setPlan] = useState("pro");

    return (
        <>
            <Section title="Real use · billing plan">
                <RadioGroup value={plan} onValueChange={setPlan} color="primary">
                    <RadioOption value="starter">Starter — $9/mo</RadioOption>
                    <RadioOption value="pro">Pro — $29/mo</RadioOption>
                    <RadioOption value="enterprise">Enterprise — custom</RadioOption>
                </RadioGroup>
            </Section>

            <Section title="Horizontal">
                <RadioGroup defaultValue="md" orientation="horizontal" color="primary">
                    <RadioOption value="sm">Small</RadioOption>
                    <RadioOption value="md">Medium</RadioOption>
                    <RadioOption value="lg">Large</RadioOption>
                </RadioGroup>
            </Section>
        </>
    );
}

Vanilla — node tree to HTML

RadioGroup / RadioOption — same shape as CheckboxGroup/CheckboxOption, one native radio per option (shared name gives arrow-key nav for free). Build a node tree, project it with toHtml(), and let the zero-dependency runtime hydrate it. This is the path for generated or user-authored documents — a site builder, CMS output, a static export.

npm i @wizeworks/silicaui-html @wizeworks/silicaui-behaviors
import { atom, toHtml } from "@wizeworks/silicaui-html";

const node = atom("RadioGroup", "radio-group", { /* props */ }, [/* children */]);
const markup = toHtml(node);

Styling on this path is the class string in the second argument — the same classes as the Plain HTML section above. There is no color prop here; write "radio-group radio-group-primary" rather than passing a colour as a prop.

Takes children
yes
Hydrated by
nothing — this one is static markup

The full API for Radio Group, on every path, is available through the Silica MCP server.