Skip to Content
✨ Just dropped my UI Library — still cooking up some magic! Stay tuned & maybe… hire me  or sponsor me 😉 
DocumentationRadioGroup

RadioGroup

A set of checkable buttons—known as radio buttons—where no more than one of the buttons can be checked at a time. Features smooth fill animations and full accessibility support.

Install Dependencies

npx
quickcode-ui add RadioGroup

Default Usage

Default Radio Group

Payment Method Selection

Payment Method Selection

Pay with your credit or debit card

Secure payment through PayPal

Direct bank account transfer

Controlled Radio Group

Controlled Radio Group

Selected plan: pro

Disabled State

Disabled Radio Group

Props

RadioGroup

PropTypeDefaultDescription
valuestringundefinedThe controlled value of the radio group
defaultValuestringundefinedThe default value when uncontrolled
onValueChange(value: string) => voidundefinedCallback fired when the value changes
namestring"radio-group"The name attribute for the radio group
disabledbooleanfalseWhether the entire radio group is disabled
classNamestringundefinedAdditional CSS classes for the container
childrenReact.ReactNoderequiredThe radio group items and their labels

RadioGroupItem

PropTypeDefaultDescription
valuestringrequiredThe value of the radio button
idstringundefinedThe id attribute for the radio button
disabledbooleanfalseWhether this specific radio button is disabled
classNamestringundefinedAdditional CSS classes for the radio button

Features

  • Smooth Fill Animation: Beautiful diagonal fill effect powered by Framer Motion
  • Full Accessibility: Proper ARIA attributes, keyboard navigation, and screen reader support
  • Flexible Composition: Use RadioGroup with RadioGroupItem components like shadcn
  • Controlled & Uncontrolled: Supports both controlled and uncontrolled usage patterns
  • Individual Disabling: Disable the entire group or individual items
  • Focus Management: Proper focus ring handling with keyboard navigation
  • Label Integration: Works seamlessly with Label components for better accessibility
  • Dark Mode Ready: Built with CSS tokens for automatic theme switching

Usage Notes

RadioGroup uses the compound component pattern . Wrap your RadioGroupItem components with RadioGroup and use Label components for accessible labeling. The component handles all radio button logic internally while providing flexibility for custom layouts and styling.

Last updated on