-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathradio.tsx
More file actions
31 lines (27 loc) · 934 Bytes
/
radio.tsx
File metadata and controls
31 lines (27 loc) · 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { Radio as BaseRadio } from "@base-ui-components/react/radio"
import { clsx as cn } from "clsx"
import { ComponentPropsWithoutRef, ElementRef, forwardRef } from "react"
import { RadioIcon } from "@/app/conf/_design-system/pixelarticons/radio-icon"
export { RadioGroup } from "@base-ui-components/react/radio-group"
export const Radio = forwardRef<
ElementRef<typeof BaseRadio.Root>,
ComponentPropsWithoutRef<typeof BaseRadio.Root>
>(({ className, ...props }, ref) => {
return (
<BaseRadio.Root
ref={ref}
className={cn(
"gql-focus-visible relative aspect-square disabled:cursor-not-allowed disabled:opacity-50",
className || "size-5",
)}
{...props}
>
<BaseRadio.Indicator
className="flex size-full -translate-y-px items-center justify-center"
keepMounted
render={RadioIcon}
/>
</BaseRadio.Root>
)
})
Radio.displayName = "Radio"