@marlon-chaviano/field-kit
Version:
A collection of reusable and accessible form components built with React, TailwindCSS, and fully integrated with React Hook Form...
20 lines (19 loc) • 728 B
TypeScript
import { type RegisterOptions } from "react-hook-form";
import * as SelectPrimitive from "@radix-ui/react-select";
type Option = {
label: string;
value: string;
};
interface SelectFieldProps extends React.ComponentProps<typeof SelectPrimitive.Root> {
name: string;
label?: string;
options: Option[];
errorClassName?: string;
placeholder?: string;
rules?: RegisterOptions;
className?: string;
wrapperClassName?: string;
triggerClassName?: string;
}
declare function SelectField({ name, options, rules, className, placeholder, triggerClassName, wrapperClassName, errorClassName, label, ...props }: SelectFieldProps): import("react/jsx-runtime").JSX.Element;
export default SelectField;