Browse docsRadio Group

ControlsNew

Glass Radio Group

A group of glass radio buttons where exactly one option is chosen.

Preview

For trying things out.
For teams shipping weekly.
For everything else.

Demos ready. Update 0.

Installation

For React 19+ apps with Tailwind CSS 4.

npx shadcn@4.14.1 add @glassyui/glass-radio-group

Adds 5 files to components/glassyui and installs @radix-ui/react-radio-group and clsx.

Usage

Usage

import { GlassRadioGroup, GlassRadioGroupItem } from "@/components/glassyui/glass-radio-group";

export function PlanDemo() {
  return (
    <GlassRadioGroup aria-label="Plan" defaultValue="pro">
      <GlassRadioGroupItem value="starter" label="Starter" />
      <GlassRadioGroupItem value="pro" label="Pro" description="For teams shipping weekly." />
    </GlassRadioGroup>
  );
}

Examples

Controlled

<GlassRadioGroup aria-label="Plan" value={plan} onValueChange={setPlan}>
  {PLANS.map((item) => (
    <GlassRadioGroupItem key={item.value} value={item.value} label={item.label} />
  ))}
</GlassRadioGroup>

API reference

GlassRadioGroup

PropTypeDefaultDescription
value / defaultValuestringNoneThe chosen option's value.
onValueChange(value: string) => voidNoneCalled when the user chooses an option.

Also accepts Radix RadioGroup.Root props.

GlassRadioGroupItem

One option. With a label, className goes to the wrapper; without one, to the button.

PropTypeDefaultDescription
valueRequiredstringNoneThe value this option sets.
labelReactNodeNoneText beside the button; clicking it chooses the option.
descriptionReactNodeNoneMuted line under the label, linked with aria-describedby. Shown only with a label.

Also accepts Radix RadioGroup.Item props, except children.

Types
GlassRadioGroupPropsGlassRadioGroupItemProps
Accessibility
Name the group with aria-label or aria-labelledby, and name any item without a label with aria-label.