Xzero UI
Pro library

Radio group

Choose one option from a visible set.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui/radio-group
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui/radio-group

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { RadioGroup } from "@/components/xzero/radio-group/radio-group";

export function PlanPicker() {
  const [plan, setPlan] = useState("team");
  return (
    <RadioGroup
      label="Plan"
      name="plan"
      value={plan}
      onValueChange={setPlan}
      options={[
        { value: "solo", label: "Solo", description: "One seat" },
        { value: "team", label: "Team", description: "Up to 20 seats" },
      ]}
    />
  );
}

API reference

RadioGroup

A fieldset of native radios where one highlight glides to the chosen row.

PropTypeDefaultDescription
label (required)string–Rendered as the fieldset legend.
options (required){ value: string; label: string; description?: string }[]–Rows in order, each with optional secondary copy.
value (required)string–Selected value.
onValueChange (required)(value: string) => void–Called with the chosen value.
namestring–Native radio name for form submission. Generated when omitted.

Keyboard interactions

KeysAction
Arrow keysMove the selection between options (native radio behavior).
TabEnters and leaves the group at the selected option.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in toggles

Guidance for AI tools

Radio group: Choose one option from a visible set. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components