Radio Group

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

API Reference

Installation

npx love-ui@latest add radio-group

Usage

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

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

Comparing with Radix / shadcn

If you’re already familiar with Radix UI and shadcn/ui, this guide highlights the small differences and similarities so you can get started with loveui quickly.

Quick Checklist

  • Use Radio going forward; RadioGroupItem remains for legacy
  • If you used asChild on parts, switch to the render prop