UNPKG

@start-base/react-form-elements

Version:

Simplify form elements and form management. Selection of user friendly inputs and wide customization abilities to match your design and functionality.

33 lines (30 loc) 1.16 kB
import React from 'react'; import { Props, GroupBase, SelectInstance } from 'react-select'; export { components as SelectComponents } from 'react-select'; import { FieldError } from 'react-hook-form'; interface Option { value: string | number; label: string | React.ReactNode; } interface SelectProps extends Props<Option, false, GroupBase<Option>> { name: string; error?: boolean | string | { message?: string; } | null | undefined | FieldError; label?: string | React.ReactNode; options?: Option[]; placeholder?: string; value?: Option | null; inputClassName?: string; labelClassName?: string; errorClassName?: string; disableShrink?: boolean; disabled?: boolean; classNames?: Record<string, any>; components?: Record<string, any>; onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void; onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void; [rest: string]: any; } declare const Select: React.ForwardRefExoticComponent<Omit<SelectProps, "ref"> & React.RefAttributes<SelectInstance<Option, false, GroupBase<Option>>>>; export { type SelectProps, Select as default };