UNPKG

@trail-ui/react

Version:
34 lines (31 loc) 1.18 kB
import * as react from 'react'; import { InputHTMLAttributes } from 'react'; import { InputVariantProps, SlotsToClasses, InputSlots } from '@trail-ui/theme'; interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'color' | 'size'>, InputVariantProps { /** * Element to be rendered in the left side of the input. */ startContent?: React.ReactNode; /** * Element to be rendered in the right side of the input. * if you pass this prop and the `onClear` prop, the passed element * will have the clear button props and it will be rendered instead of the * default clear button. */ endContent?: React.ReactNode; /** * Classes object to style the input and its children. */ classNames?: SlotsToClasses<InputSlots>; /** * Callback fired when the value is cleared. * if you pass this prop, the clear button will be shown. */ onClear?: () => void; 'data-value'?: string; } /** * An input allows a user to input text. */ declare const _Input: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>; export { _Input as Input, InputProps };