SearchInput

A search input type component.

Props#

The SearchInput composes the Input component, so you can use all the Input props.

PropTypeDefaultDescription
colorScheme"whiteAlpha" | "blackAlpha" | "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | "purple" | "pink" | "linkedin" | "facebook" | "messenger" | "whatsapp" | "twitter" | "telegram" | "primary" | "secondary" | "indigo"The visual color appearance of the component
errorBorderColorstringThe border color when the input is invalid. Use color keys in `theme.colors`
focusBorderColorstringThe border color when the input is focused. Use color keys in `theme.colors`
htmlSizenumberThe native HTML size attribute to be passed to the input
iconReactElement<any, string | JSXElementConstructor<any>>The icon to render before the input text
isDisabledbooleanfalseIf true, the form control will be disabled. This has 2 side effects: - The FormLabel will have `data-disabled` attribute - The form element (e.g, Input) will be disabled
isInvalidbooleanfalseIf true, the form control will be invalid. This has 2 side effects: - The FormLabel and FormErrorIcon will have `data-invalid` set to true - The form element (e.g, Input) will have `aria-invalid` set to true
isReadOnlybooleanfalseIf true, the form control will be readonly
isRequiredbooleanfalseIf true, the form control will be required. This has 2 side effects: - The FormLabel will show a required indicator - The form element (e.g, Input) will have `aria-required` set to true
onReset() => voidCallback to trigger when the reset button is clicked or escape key is pressed
placeholderstringSearchThe placeholder text for the input
resetIconReactElement<any, string | JSXElementConstructor<any>>The icon to render in the reset button
rightElementReactElement<any, string | JSXElementConstructor<any>>Right element rendered when the value is empty
size"sm" | "lg"The size of the SearchInput
variantstringThe variant of the SearchInput
PropTypeDefaultDescription
colorScheme"whiteAlpha" | "blackAlpha" | "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | "purple" | "pink" | "linkedin" | "facebook" | "messenger" | "whatsapp" | "twitter" | "telegram"The visual color appearance of the component
errorBorderColorstringThe border color when the input is invalid. Use color keys in `theme.colors`
focusBorderColorstringThe border color when the input is focused. Use color keys in `theme.colors`
htmlSizenumberThe native HTML size attribute to be passed to the input
isDisabledbooleanfalseIf true, the form control will be disabled. This has 2 side effects: - The FormLabel will have `data-disabled` attribute - The form element (e.g, Input) will be disabled
isInvalidbooleanfalseIf true, the form control will be invalid. This has 2 side effects: - The FormLabel and FormErrorIcon will have `data-invalid` set to true - The form element (e.g, Input) will have `aria-invalid` set to true
isReadOnlybooleanfalseIf true, the form control will be readonly
isRequiredbooleanfalseIf true, the form control will be required. This has 2 side effects: - The FormLabel will show a required indicator - The form element (e.g, Input) will have `aria-required` set to true
size"lg" | "md" | "sm" | "xs"mdThe size of the Input
variant"outline" | "filled" | "flushed" | "unstyled"outlineThe variant of the Input

Was this helpful?