Component

Radio Group

A set of checkable buttons—known as radio buttons—where no more than one button can be checked at a time. Designed with thick brutalist borders, custom circular check fills, and clean disabled states.


Preview

Installation

pnpm dlx brutx@latest add radio-group

Usage

import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"
import { Label } from "@/components/ui/label"

<RadioGroup defaultValue="option-one">
  <div className="flex items-center space-x-2">
    <RadioGroupItem value="option-one" id="option-one" />
    <Label htmlFor="option-one">Option One</Label>
  </div>
  <div className="flex items-center space-x-2">
    <RadioGroupItem value="option-two" id="option-two" />
    <Label htmlFor="option-two">Option Two</Label>
  </div>
</RadioGroup>

Examples

Disabled State

Disabled radio choices turn grey and inherit standard pointer-events exclusion rules.

API Reference

ComponentDescription
RadioGroupContext root that handles active values and selection loops.
RadioGroupItemIndividual circular check option triggering click callbacks.

Accessibility

Keyboard Navigation Key Rules:

  • Tab: Moves focus to the selected radio button in the group.
  • ArrowDown / ArrowRight: Moves focus and checks the next radio button in the group.
  • ArrowUp / ArrowLeft: Moves focus and checks the previous radio button in the group.