shadcn, restyled · @jengacore/radio-group
Radio Group
shadcn Radio Group, restyled: jengacore focus ring, radii, card fill, navy scrim and shadow-pop.
Separate Radix and Base UI builds
Install
terminal
npx shadcn@latest add @jengacore/radio-groupWithout the namespace configured: npx shadcn@latest add https://ui.jengacore.com/r/<new-york-v4|base-nova>/radio-group.json
Registry dependencies
npm packages
radix-ui
Source
components/ui/radio-group.tsx
// jengacore: shadcn new-york/radio-group, restyled by scripts/import-upstream.ts. Change the codemod, not this file.
"use client"
import * as React from "react"
import { cn } from "@/lib/utils"
import { CircleIcon } from "lucide-react"
import { RadioGroup as RadioGroupPrimitive } from "radix-ui"
function RadioGroup({
className,
...props
}: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {
return (
<RadioGroupPrimitive.Root
data-slot="radio-group"
className={cn("grid gap-3", className)}
{...props}
/>
)
}
function RadioGroupItem({
className,
...props
}: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {
return (
<RadioGroupPrimitive.Item
data-slot="radio-group-item"
className={cn(
"aspect-square size-4 shrink-0 rounded-full border border-input text-primary transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50 focus-field",
className
)}
{...props}
>
<RadioGroupPrimitive.Indicator
data-slot="radio-group-indicator"
className="relative flex items-center justify-center"
>
<CircleIcon className="absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 fill-primary" />
</RadioGroupPrimitive.Indicator>
</RadioGroupPrimitive.Item>
)
}
export { RadioGroup, RadioGroupItem }