Update themed components with refs and css
This commit is contained in:
@@ -1,21 +1,23 @@
|
||||
import type { RadioButtonProps } from "$/types/InputTypes";
|
||||
import { Radio } from "@headlessui/react";
|
||||
import clsx from "clsx";
|
||||
import { forwardRef } from "react";
|
||||
|
||||
|
||||
export default function RadioButton({
|
||||
const RadioButton = forwardRef<HTMLInputElement, RadioButtonProps>(({
|
||||
id,
|
||||
className,
|
||||
labelClassName,
|
||||
size = "sm",
|
||||
value,
|
||||
children
|
||||
}: RadioButtonProps){
|
||||
}, ref ) => {
|
||||
return (
|
||||
<Radio
|
||||
id={id}
|
||||
value={value}
|
||||
className="group flex flex-row items-center justify-center gap-x-2 cursor-pointer"
|
||||
ref={ref}
|
||||
>
|
||||
<div
|
||||
className={clsx(
|
||||
@@ -41,4 +43,8 @@ export default function RadioButton({
|
||||
}
|
||||
</Radio>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
RadioButton.displayName = "RadioButton";
|
||||
|
||||
export default RadioButton;
|
||||
|
||||
Reference in New Issue
Block a user