Global Search api

Overview
API
Theme
Examples

NbSearchComponent

Inputs

NameTypeDescription
hintstring

Hint showing under the input field to improve user experience

placeholderstring

Search input placeholder

tagstring

Tags a search with some ID, can be later used in the search service to determine which search component triggered the action, if multiple searches exist on the page.

typeNbSearchType

Search design type, available types are modal-zoomin, rotate-layout, modal-move, curtain, column-curtain, modal-drop, modal-half

NbSearchService

Methods

NameDescription
activateSearch()
parameters: searchType: string, tag: string
returns:void

Activate (open) search component

deactivateSearch()
parameters: searchType: string, tag: string
returns:void

Deactibate (close) search component

onSearchActivate()
returns:Observable<{searchType: string; tag?: string}>

Subscribe to 'activate' event

onSearchDeactivate()
returns:Observable<{searchType: string; tag?: string}>

Subscribe to 'deactivate' event

onSearchInput()
returns:Observable<{term: string; tag?: string}>

Subscribe to input event

onSearchSubmit()
returns:Observable<{term: string; tag?: string}>

Subscribe to 'submit' event (when submit button clicked)

searchInput()
parameters: term: string, tag: string
returns:void

Trigger search submit by input event

submitSearch()
parameters: term: string, tag: string
returns:void

Trigger search submit

Window
Previous page
User (Avatar)
Next page

Need some help or found an issue?

Ask on Stack Overflow with tag `nebular` or post an issue on GitHub.