Glrk UI

Radio

A wrapper for Base UI Radio and RadioGroup with label/description support, controlled state, and orientation control.

RadioWrapper
items — with descriptions and disabled
value + onValueChange — controlled

Selected: email

orientation: horizontal
Primitives
RadioGroup + Radio — manual composition

Installation

npx shadcn@latest add @glrk-ui/radio

If you haven't set up the prerequisites yet, check out registry setup.

Usage

Group — RadioWrapper

import { RadioWrapper } from "@/components/ui/radio"

<RadioWrapper
  defaultValue="email"
  items={[
    { value: "email", label: "Email", description: "Receive updates via email." },
    { value: "sms", label: "SMS", description: "Receive updates via text." },
    { value: "push", label: "Push notifications" },
    { value: "disabled", label: "Unavailable", disabled: true },
  ]}
/>

Controlled

const [value, setValue] = useState("email")

<RadioWrapper
  value={value}
  onValueChange={(v) => setValue(v as string)}
  items={[
    { value: "email", label: "Email" },
    { value: "sms", label: "SMS" },
    { value: "push", label: "Push" },
  ]}
/>

Horizontal orientation

<RadioWrapper
  defaultValue="light"
  orientation="horizontal"
  items={[
    { value: "light", label: "Light" },
    { value: "dark", label: "Dark" },
    { value: "system", label: "System" },
  ]}
/>

Single radio — Radio

import { RadioGroup, Radio } from "@/components/ui/radio"

<RadioGroup defaultValue="b">
  <Radio value="a" label="Option A" description="First choice." />
  <Radio value="b" label="Option B" description="Second choice." />
  <Radio value="c" label="Disabled" disabled />
</RadioGroup>

Reference

radioOptionT

Prop

Type

Radio

Prop

Type

RadioWrapper

Prop

Type