radio-group
neobrutalui/radio-groupFreeComponent
Let users select exactly one option from a group.
Live preview
live · rendered by the registry
Rendered by neobrutalui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://www.neobrutalui.live/r/radio-group.jsonSource
1"use client"23import * as React from "react"4import { Radio } from "@base-ui/react/radio"5import { RadioGroup as BaseRadioGroup } from "@base-ui/react/radio-group"6import { cn } from "@/lib/utils"78type RadioGroupProps = React.ComponentPropsWithoutRef<typeof BaseRadioGroup>910const RadioGroup = React.forwardRef<11 React.ComponentRef<typeof BaseRadioGroup>,12 RadioGroupProps13>(({ className, ...props }, ref) => (14 <BaseRadioGroup15 className={cn("grid gap-3", className)}16 {...props}17 ref={ref}18 />19))20RadioGroup.displayName = "RadioGroup"2122type RadioGroupItemProps = React.ComponentPropsWithoutRef<typeof Radio.Root>2324const RadioGroupItem = React.forwardRef<25 React.ComponentRef<typeof Radio.Root>,26 RadioGroupItemProps27>(({ className, ...props }, ref) => (28 <Radio.Root29 ref={ref}30 className={cn(31 "peer h-5 w-5 shrink-0 rounded-full border-2 border-black bg-white focus-brutal disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 data-checked:bg-main",32 className33 )}34 {...props}35 >36 <Radio.Indicator className="flex h-full w-full items-center justify-center data-unchecked:hidden">37 <span className="h-2 w-2 rounded-full bg-black" />38 </Radio.Indicator>39 </Radio.Root>40))41RadioGroupItem.displayName = "RadioGroupItem"4243export { RadioGroup, RadioGroupItem }
What it pulls in
npm packages
Other registry items
More from neobrutalui
All 24 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | neobrutalui | Components | Free | 2 deps | |
| alertalert | neobrutalui | Components | Free | 1 dep | |
| avataravatar | neobrutalui | Components | Free | no deps | |
| badgebadge | neobrutalui | Components | Free | 1 dep | |
| buttonbutton | neobrutalui | Components | Free | 1 dep | |
| cardcard | neobrutalui | Components | Free | no deps | |
| checkboxcheckbox | neobrutalui | Components | Free | 2 deps | |
| date-pickerdate-picker | neobrutalui | Components | Free | 2 deps |
