Search input with specific styles.
minimal
appendToBody
fullWidth
remote
searchIcon={<FileMagnifyingGlassIcon size={16} />}
searchIcon={false}
uncontrolled
Property | Type | Required | Default | Description |
---|---|---|---|---|
placeholder | String | false | Search... | Text for the placeholder property on the input. |
dataSourceConfig | Object | false | { label: label, value: value } | An object used to map properties to the name and value of items (only applies if `items` is an array of objects). |
placement | Enum | false | bottom-start | Placement of the popover in relation to the target. |
shortcutTooltip | Node | false | Press / to search | Text used in the shortcut tooltip to describe what the shortcut is. |
virtualizedRowHeight | Union | false | 42 | (virtualized only) Row height used to calculate how many rows to render in a virtualized menu. |
searchIcon | Node | false | <MagnifyingGlassIcon filled size={16} /> | SVG icon to be displayed inside the Search input |
clearIcon | Node | false | <XCircleIcon filled size={16} color={CalciteTheme.palette.darkerGray} /> | SVG icon to clear the value of the Search input |
onUserAction | Func | false | () => {} | Function called when the input value is changed, items dropdown hides/shows, or when the user hovers over or clicks on an item. |
onChange | Func | false | () => {} | Function called when an item is selected. |
onRequestClear | Func | false | () => {} | Function called when the user clicks the clear button. |
remote | Bool | false | false | Use a remote API for the data load. This will allow the application to see the exact return from the API with no filtering applied |
items | Array | false | - | Array of items. |
inputValue | String | false | - | Text in the input. |
selectedItem | Any | false | - | The selected item. |
minimal | Bool | false | - | Toggle minimal style on the input. |
fullWidth | Bool | false | - | Whether or not the Search and its menu will fill the container's width. |
containerStyle | Object | false | - | Style prop applied to the Search container element. |
menuStyle | Object | false | - | Style prop applied to the menu wrapper. |
shortcutCharacter | String | false | - | Character used to display a shortcut icon on the right side of the Search input. |
positionFixed | Bool | false | - | Uses `position: fixed` on the tooltip allowing it to show up outside of containers that have `overflow: hidden`. |
children | Node | false | - | You can add Search options as children if you want more control over the item rendering. Search MenuItems can take either an item object that maps to your dataSourceConfig, or you can manually set the label and value props on MenuItems. |
virtualized | Bool | false | - | Use react-virtualized to render rows as the user scrolls. |
virtualizedMenuWidth | Number | false | - | (virtualized only) Width of the menu; unloaded rows may be wider than the initial set. |
popperModifiers | Object | false | - | Modifiers to be passed to the Popper element |