Radio Group

A set of checkable buttons where only one can be checked at a time, forming a radio selection.

ui@radix-ui/react-radio-grouplucide-react

Installation

$npx futureuikit add radio-group

Import

import { RadioGroup } from "@/components/ui/radio-group"
Layout Variant
Color Theme
Shape
Spacing / Size

Named Keys & Props

Pass these exact named keys as props on <RadioGroup />. Click any color pill to copy the prop.

colorDefault is "default"(Black & White)
variantVisual style
"modern""minimal""glow"
shapeCorner shape
"default""square""rounded""sharp"
spacingInner spacing
"default""2x""4x""6x""8x"

Usage Example

A basic implementation example to get you started.

Example Implementation
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";

export default function Example() {
  return (
    <RadioGroup defaultValue="option-1">
      <div className="flex items-center space-x-2">
        <RadioGroupItem value="option-1" id="option-1" />
        <label htmlFor="option-1">Option 1</label>
      </div>
      <div className="flex items-center space-x-2">
        <RadioGroupItem value="option-2" id="option-2" />
        <label htmlFor="option-2">Option 2</label>
      </div>
    </RadioGroup>
  );
}

Features

Key capabilities and highlights.

Key Capabilities
  • ◆Ensures single-selection behavior across all items in the group.
  • ◆Built on Radix UI for full accessibility and keyboard support.
  • ◆Easily styled and integrated with form libraries.

Notes

Important implementation details to consider.

Implementation Details
  • ◆Install: Run 'npx futureuikit add radio-group'.
  • ◆Import: 'import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";'
  • ◆Usage: Wrap RadioGroupItem elements inside a RadioGroup with a defaultValue.