Skip to content

Radio Group

A set of checkable buttons where no more than one of the buttons can be checked at a time.

API Reference

Installation

pnpm dlx shadcn@latest add @frontal-labs/radio-group

Usage

import { Label } from "@/components/ui/label";
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
<RadioGroup defaultValue="next">
  <Label>
    <RadioGroupItem value="next" /> Next.js
  </Label>
  <Label>
    <RadioGroupItem value="vite" /> Vite
  </Label>
  <Label>
    <RadioGroupItem value="astro" /> Astro
  </Label>
</RadioGroup>

API Reference

RadioGroup

Root component. Styled wrapper for RadioGroup from Base UI, laid out as a full-width grid with a gap-2.

RadioGroupItem

Individual radio button. Styled wrapper for Radio.Root from Base UI with a built-in indicator.

In light mode the control carries a bg-muted fill on top of its border, so an unselected radio stays visible against a white surface instead of relying on the border alone.

Examples

For accessible labelling and validation, prefer using the Field component to wrap radio buttons. See the related example: Radio Group field.

Disabled

With Description

Card Style

Form Integration