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.
The preview runs the React version. On iOS 26 and later, the React Native version uses the system’s own glass. See it on a phone.
Installation
For React 19+ apps with Tailwind CSS 4.
npx shadcn@4.14.1 add @glassyui/glass-radio-groupAdds 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>
);
}React Native usage
import { useState } from 'react';
import { GlassRadioGroup, GlassRadioGroupItem } from '@/components/glassyui/glass-radio-group';
export default function RadioGroupExample() {
const [delivery, setDelivery] = useState('standard');
return (
<GlassRadioGroup accessibilityLabel="Delivery" onValueChange={setDelivery} value={delivery}>
<GlassRadioGroupItem description="Three to five days." label="Standard" value="standard" />
<GlassRadioGroupItem description="Next working day." label="Express" value="express" />
</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
| Prop | Type | Default | Description |
|---|---|---|---|
value / defaultValue | string | None | The chosen option's value. |
onValueChange | (value: string) => void | None | Called 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.
| Prop | Type | Default | Description |
|---|---|---|---|
valueRequired | string | None | The value this option sets. |
label | ReactNode | None | Text beside the button; clicking it chooses the option. |
description | ReactNode | None | Muted 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.
The React Native props and exports are in the component’s source.