mirror of
https://bitbucket.org/Mattrixwv/mattrixwvreactcomponents.git
synced 2025-12-07 06:03:58 -05:00
36 lines
641 B
TypeScript
36 lines
641 B
TypeScript
import type { RadioListProps } from "$/types/InputTypes";
|
|
import { RadioGroup } from "@headlessui/react";
|
|
import clsx from "clsx";
|
|
|
|
|
|
export default function RadioList({
|
|
id,
|
|
className,
|
|
name,
|
|
value,
|
|
onChange,
|
|
defaultValue,
|
|
direction = "horizontal",
|
|
children
|
|
}: RadioListProps){
|
|
return (
|
|
<RadioGroup
|
|
id={id}
|
|
className={clsx(
|
|
"flex items-center justify-center",
|
|
className,
|
|
{
|
|
"flex-row gap-x-8": direction === "horizontal",
|
|
"flex-col gap-y-2": direction === "vertical"
|
|
}
|
|
)}
|
|
name={name}
|
|
value={value}
|
|
onChange={onChange}
|
|
defaultValue={defaultValue}
|
|
>
|
|
{children}
|
|
</RadioGroup>
|
|
);
|
|
}
|