Radio Group
uiable/radio-groupFreeComponent
Radio Group component.
Live preview
live · rendered by the registry
Rendered by uiable on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://uiable.com/r/radio-group.jsonSource
1"use client";23import { Radio as RadioPrimitive } from "@base-ui/react/radio";4import { RadioGroup as RadioGroupPrimitive } from "@base-ui/react/radio-group";56import { cn } from "@/lib/utils";78function RadioGroup({ className, ...props }: RadioGroupPrimitive.Props) {9 return (10 <RadioGroupPrimitive11 data-slot="radio-group"12 className={cn("grid w-full gap-2", className)}13 {...props}14 />15 );16}1718function RadioGroupItem({ className, ...props }: RadioPrimitive.Root.Props) {19 return (20 <RadioPrimitive.Root21 data-slot="radio-group-item"22 className={cn(23 "border-border dark:bg-border/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 dark:aria-invalid:border-destructive/50 group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3",24 className25 )}26 {...props}27 >28 <RadioPrimitive.Indicator29 data-slot="radio-group-indicator"30 className="flex size-[17.5] items-center justify-center"31 >32 <span className="bg-primary-foreground absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full" />33 </RadioPrimitive.Indicator>34 </RadioPrimitive.Root>35 );36}3738export { RadioGroup, RadioGroupItem };
What it pulls in
npm packages
Files it writes
More from uiable
All 712 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | uiable | Components | Free | 2 deps | |
| Alertalert | uiable | Components | Free | 1 dep | |
| Alert Dialogalert-dialog | uiable | Components | Free | 1 dep | |
| Aspect Ratioaspect-ratio | uiable | Components | Free | no deps | |
| Attachmentattachment | uiable | Components | Free | 2 deps | |
| Avataravatar | uiable | Components | Free | 1 dep | |
| Badgebadge | uiable | Components | Free | 2 deps | |
| Breadcrumbbreadcrumb | uiable | Components | Free | 2 deps |
