Go Main page
Go Main page

Web components

cover

components

Input Search

v.1.0.0 | Saturn

Usage

import { InputSearch } from '@kubit-ui-web/react-components'
12345678910
<InputSearch
  variant="ALTERNATIVE"
  label={{ content: 'Label' }}
  placeholder='Placeholder'
  hasResultTextWrittenByUser={false}
  disableErrorInvalidOption={true}
  optionList={[
    {
      options: ['Street 1', 'Street 2', 'Avenue 1'],
    },

Props

Let's delve into the versatility of the inputSearch component by examining all its avalaible props.

PropertyTypeDefaultDescription
variant
Required
String-Variant of InputSearch
optionList
Required
IOptionGroup-List of options to show
inputVariantString-Set the Input's variant
openBooleanfalseIndicates if inputSearch is open or not
disabledBoolean-Specifies if the input element is disabled or not
internalErrorExecutionINTERNAL_ERROR_EXECUTIONonChangeOnBlurWhen error handling
errorBoolean-Specifies if the input element has error or not
searchFilterConfigSearchFilterConfig-Config about the search filter
disableErrorInvalidOptionBoolean-It disables the INVALID_OPTION error
regexString-Custom regex for input search
onClick(event: MouseEvent) => void-Function that is called when user clicks on input
clearTextInputPopoverIconClickBooleantrueIt indicates if click on the icon of the input in the ActionBottomSheet clears the input value
onChange(event: ChangeEvent) => void-Function that is called when writting or selecting an element on the component
onInputPopoverIconClick() => void-Function that is called when click on the input icon in the ActionBottomSheet
onOptionsListKeyDown(event: KeyboardEvent) => void-Function that is called when navigates with arrows through options list
onPopoverOpen(open: boolean) => void-Function that is called when opening or closing the popover
onOptionClickIInputSearchStandAlone-Function that is called when an option is clicked
valueString-Option value selected
titleActionBottomSheetString-Title of the ActionBottomSheet
loadingListBoolean-Add loading in result list when database does not find results
loadingTextString-Text for loading result list
elementsToShowNumber4Number of elements to show
noResultsTextInputSearchNoResultTextType-Message to display when results are empty
highlightedOptionString-Displays by default a highlighted option above the predefined ones that will disappear if the user enters text in the input.
hasResultTextWrittenByUserBooleantrueShow or not the search option in the list
sublabelstring-Message displayed next to the suggested result
closeIconIElementOrIcon-Add close icon
iconIElementOrIcon-Add icon to input
inputPopoverIconIElementOrIcon-Set icon of the input icon in the ActionBottomSheet
blockBackPopoverBooleanfalseIt indicates if what it is behind the popover is blocked
executeInternalOpenOptionsBooleantrueIt prevents the call of the handleOpenOptions function, to control whether the options are opened, when the input icon is clicked
optionsListDefaultAriasOptionGroupAriasTypes-Arias for the options list
ctvInputSearchStylesProps-Modify styles for the default version of the component

Initialized extended props

PropertyTypeDefaultDescription
typeInputTypeTypeTextThe type attribute specifies the type of input element to display. If the type attribute is not specified, the default type is text"