radio-group
yyc3-knowledge-base/radio-groupUnverifiedComponent
shadcn/ui publishes no description for this item.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/YYC-Cube/YYC3-Knowledge-Base/main/YYC3-D/ui/apps/v4/radio-group.jsonSource
1"use client"23import * as React from "react"4import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"5import { Circle } from "lucide-react"67import { cn } from "@/lib/utils"89const RadioGroup = React.forwardRef<10 React.ElementRef<typeof RadioGroupPrimitive.Root>,11 React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>12>(({ className, ...props }, ref) => {13 return (14 <RadioGroupPrimitive.Root15 className={cn("grid gap-2", className)}16 {...props}17 ref={ref}18 />19 )20})21RadioGroup.displayName = RadioGroupPrimitive.Root.displayName2223const RadioGroupItem = React.forwardRef<24 React.ElementRef<typeof RadioGroupPrimitive.Item>,25 React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>26>(({ className, ...props }, ref) => {27 return (28 <RadioGroupPrimitive.Item29 ref={ref}30 className={cn(31 "aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",32 className33 )}34 {...props}35 >36 <RadioGroupPrimitive.Indicator className="flex items-center justify-center">37 <Circle className="h-3.5 w-3.5 fill-primary" />38 </RadioGroupPrimitive.Indicator>39 </RadioGroupPrimitive.Item>40 )41})42RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName4344export { RadioGroup, RadioGroupItem }
What it pulls in
npm packages
Files it writes
More from shadcn/ui
All 411 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | shadcn/ui | Components | Unverified | 1 dep | |
| alertalert | shadcn/ui | Components | Unverified | no deps | |
| alert-dialogalert-dialog | shadcn/ui | Components | Unverified | 1 dep | |
| aspect-ratioaspect-ratio | shadcn/ui | Components | Unverified | 1 dep | |
| avataravatar | shadcn/ui | Components | Unverified | 1 dep | |
| badgebadge | shadcn/ui | Components | Unverified | 1 dep | |
| breadcrumbbreadcrumb | shadcn/ui | Components | Unverified | 1 dep | |
| buttonbutton | shadcn/ui | Components | Unverified | 1 dep |
