created:3/15/2021
updated:3/15/2021
source lines:182
comments %:23
SearchInput
an input component combined with a popover, can be used for incremental search.
Name | Description | Default | |
---|---|---|---|
SearchInputOwnProps (6 properties) | |||
onSearch | callback on change of search input. user can retrieve items in this callback (search: string) => void | Promise<void> | - | |
onSelect | on select a search item. (item: ItemType) => void | - | |
children | children is a render prop to allow custom rendering of items, one at a time ((props: SearchBoxCallbackProps<ItemType>) => ReactNode) | (((props: SearchBoxCallbackProps<ItemType>) => ReactNode) & string) | ... 5 more ... | (((props: SearchBoxCallbackProps<...>) => ReactNode) & ReactPortal) | - | |
items | items array ItemType[] | [] | |
popoverProps | customize the popover PopoverProps | - | |
render | custom renver of the search items popup (rendered: ReactNode) => ReactNode | rendered => rendered | |
InputHTMLAttributes (34 properties) | |||
SpaceProps (28 properties) | |||
HTMLAttributes (43 properties) | |||
Attributes (1 properties) | |||
AriaAttributes (48 properties) | |||
DOMAttributes (159 properties) | |||
BoxOwnProps (4 properties) | |||
BackgroundColorProps (2 properties) | |||
OpacityProps (1 properties) |
package | imports | peer |
---|---|---|
@primer/octicons-react ^10.0.0 | SearchIcon | |
react ^17.0.1 | useStateuseEffectReactNode | * |
scroll-into-view-if-needed ^2.2.25 | scrollIntoView | |
theme-ui ^0.6.0-alpha.7 | jsxInputPropsInputBox |
file | imports |
---|---|
"../Popover" | PopoverPopoverProps |
"../Keyboard" | KeyboardDOWN_ARROWUP_ARROWRETURNESCTAB |