Back to Input
Input

Icons & clear

Leading/trailing icons and a clearable search field.

API

PropTypeDefaultDescription
labelReact.ReactNodeField label.
helpTextReact.ReactNodeSupplementary help text shown when there's no error.
errorReact.ReactNodeError text; also sets `aria-invalid` and switches to the destructive style.
size"sm" | "md" | "lg"mdField height.
leadingIcon / trailingIconReact.ReactNodeIcon slots either side of the input.
iconReact.ReactNodeShorthand icon slot — any React node (custom SVG, Icon, emoji). Defaults to leading.
iconPosition"leading" | "trailing"leadingWhich side the `icon` prop renders on.
clearablebooleanShows a clear button once the field has a value.
value / defaultValuestringControlled / uncontrolled value.
onValueChange(value: string) => voidConvenience change handler (in addition to native onChange).
classNamestringMerged onto the native <input> element.
containerClassNamestringMerged onto the outer field wrapper.
wrapperClassNamestringMerged onto the bordered input wrapper.
onBlur, onFocus, onKeyDown, onChange, …InputHTMLAttributes<HTMLInputElement>All native input events and attributes are forwarded to the underlying <input>.
View full API on Input

More Input examples