Search @ngb-bootstrap/core/search
<ngb-search>Component
NgbSearch
search ); the component draws them, handles the keyboard and remembers what was
opened. Ctrl K (⌘K on Apple devices) opens it from anywhere on the page.
The field is a WAI-ARIA combobox whose results are a listbox: ↑ and ↓ move the highlight, Enter
opens the highlighted result and Escape closes. Ctrl D (⌘D) saves the highlighted result to
Favorites or removes it, Delete removes a saved one; the row buttons do the same with a mouse.
Recent and Favorites live in localStorage under storageKey .
<ngb-search [search]="find" placeholder="Search docs" storageKey="my-docs-search" />| Name | Type | Default |
|---|---|---|
[search]required | NgbSearchFn | — |
[label]search.label string. | string | — |
[placeholder]search.placeholder string. | string | — |
[storageKey]localStorage key under which Recent and Favorites are kept. | string | 'ngb-search' |
[recentLimit] | number | 8 |
[hotkey] | boolean | true |
(selected) | NgbSearchResult | — |
NgbSearchFnType
type NgbSearchFn = ( query: string, ) => readonly NgbSearchResult[] | PromiseLike<readonly NgbSearchResult[]>NgbSearchResultInterface
| Name | Type | Default |
|---|---|---|
titlerequired | string | — |
sectionComponents › Buttons . | string | — |
linkrequired#fragment or a query), or
an absolute URL, which is opened with a full page load. | string | — |
group | string | — |