created:3/5/2021
updated:3/5/2021
loc
183
comments
23%
passed
8
coverage
10%
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) & (boolean | ReactChild | ReactFragment | ReactPortal | null)) | - | |
items | items array ItemType[] | [] | |
popoverProps | customize the popover PopoverProps | - | |
render | custom renver of the search items popup ((rendered: ReactNode) => ReactNode) | rendered => rendered | |
InputHTMLAttributes(33 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) |
12 commits
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.8.4 | jsxInputPropsInputBox |
file | imports |
---|---|
"../Popover" | PopoverPopoverProps |
"../Keyboard" | KeyboardDOWN_ARROWUP_ARROWRETURNESCTAB |