InterfaceSearchBarProps
Interface: InterfaceSearchBarProps
Defined in: src/types/SearchBar/interface.ts:33
Strongly typed props for the shared SearchBar component.
Extends
Omit<React.InputHTMLAttributes<HTMLInputElement>,"onChange"|"size">
Properties
buttonAriaLabel?
optionalbuttonAriaLabel:string
Defined in: src/types/SearchBar/interface.ts:75
Accessible label for the search button.
buttonClassName?
optionalbuttonClassName:string
Defined in: src/types/SearchBar/interface.ts:55
Additional class applied to the search button.
buttonLabel?
optionalbuttonLabel:string
Defined in: src/types/SearchBar/interface.ts:73
Optional label shown inside the search button.
buttonTestId?
optionalbuttonTestId:string
Defined in: src/types/SearchBar/interface.ts:59
Button test id override.
className?
optionalclassName:string
Defined in: src/types/SearchBar/interface.ts:51
Additional class applied to the container.
Overrides
Omit.className
clearButtonTestId?
optionalclearButtonTestId:string
Defined in: src/types/SearchBar/interface.ts:61
Clear button test id override.
defaultValue?
optionaldefaultValue:string
Defined in: src/types/SearchBar/interface.ts:43
Initial value when used in uncontrolled mode.
Overrides
Omit.defaultValue
icon?
optionalicon:ReactNode
Defined in: src/types/SearchBar/interface.ts:79
Optional custom icon rendered inside the input field.
inputClassName?
optionalinputClassName:string
Defined in: src/types/SearchBar/interface.ts:53
Additional class applied to the input element.
inputTestId?
optionalinputTestId:string
Defined in: src/types/SearchBar/interface.ts:57
Input test id override.
isLoading?
optionalisLoading:boolean
Defined in: src/types/SearchBar/interface.ts:77
Renders a loading spinner inside the button when true.
onChange()?
optionalonChange: (value,event?) =>void
Defined in: src/types/SearchBar/interface.ts:47
Callback fired whenever the input value changes.
Parameters
value
string
event?
ChangeEvent<HTMLInputElement>
Returns
void
onClear()?
optionalonClear: () =>void
Defined in: src/types/SearchBar/interface.ts:49
Callback fired after the clear button is pressed.
Returns
void
onSearch()?
optionalonSearch: (value,metadata?) =>void
Defined in: src/types/SearchBar/interface.ts:45
Callback invoked when the user submits a search via button, Enter, or clear.
Parameters
value
string
metadata?
Returns
void
placeholder?
optionalplaceholder:string
Defined in: src/types/SearchBar/interface.ts:39
Placeholder text for the search input.
Overrides
Omit.placeholder
showClearButton?
optionalshowClearButton:boolean
Defined in: src/types/SearchBar/interface.ts:69
Toggle visibility of the inline clear button. Defaults to true.
showLeadingIcon?
optionalshowLeadingIcon:boolean
Defined in: src/types/SearchBar/interface.ts:71
Toggle the leading search icon visibility. Defaults to true.
showSearchButton?
optionalshowSearchButton:boolean
Defined in: src/types/SearchBar/interface.ts:67
Toggle visibility of the trailing search button. Defaults to true.
size?
optionalsize:SearchBarSize
Defined in: src/types/SearchBar/interface.ts:63
Visual size of the component.
value?
optionalvalue:string
Defined in: src/types/SearchBar/interface.ts:41
Controlled input value.
Overrides
Omit.value
variant?
optionalvariant:SearchBarVariant
Defined in: src/types/SearchBar/interface.ts:65
Visual variant of the component.