Common Settings
Search
Customize search-related settings for the Inkeep widgets.
InkeepSearchSettings
This interface is used to configure the search settings for the Inkeep widgets.
All properties are optional.
Property | Type | Description |
---|---|---|
placeholder | string | Placeholder text for the search input field. Default 'Search for anything...' for large screens and 'Search...' for small screens. |
prefilledQuery | string | The prefilled query that will appear in the search bar. Default undefined . |
shouldOpenLinksInNewTab | boolean | Determines whether links should open in a new tab. Default false . |
isControlledSearchQuery | boolean | Determines whether the search query will be controlled by a wrapping component. Default false . Use along side handleSearchQueryChange and searchFunctionsRef . |
handleSearchQueryChange | (query: string) => void | Callback for when the search query changes. isControlledSearchQuery must be true . To be used along side searchFunctionsRef . |
tabSettings | InkeepTabSettings | Settings for tabs in search results. |
maximumHitsLimit | number | Max number of results to show for a search. Default is 40 . |
debounceTime | number | Number of milliseconds to wait before fetching search results. Default is 0 . |
searchFunctionsRef | React.Ref<SearchFunctions> | Ref to the component's callable functions for search. See here. |
shouldShowAskAICard | boolean | Whether or not to show the Ask AI "<query>" card in the search results. Default true . |
searchQueryParamKey | string | If this property is set, the search query will be appended to search result links as a query param under the specified key. Default is undefined . |
InkeepTabSettings
These settings control the tab behavior in search results.
All properties are optional.
Property | Type | Description |
---|---|---|
isAllTabEnabled | boolean | Enables the 'All' tab in search results. Default true . |
rootBreadcrumbsToUseAsTabs | string[] | Specify a list of root breadcrumbs to put into individual tabs. For example, ['Docs', 'Blog'] . Only applies for search results that include breadcrumbs. Default [] . |
tabOrderByLabel | string[] | Controls the order of the tabs. Defaults to ['All', ...rootBreadcrumbsToUseAsTabs, ...defaultExternalSources] . defaultExternalSources includes GitHub, Discourse, Slack and Discord. |
disabledDefaultTabs | string[] | List tabs you to not show. Useful for disabling certain default tabs, like 'GitHub' or 'Slack' as standalone tabs. |
alwaysDisplayedTabs | string[] | Tabs that should always be displayed, including during the loading animation and regardless of whether there are any matching search results. Defaults to ['All', ...rootBreadcrumbsToUseAsTabs] . |
Example
SearchFunctions
The SearchFunctions
interface provides a set of functions that can be used to programmatically interact with the search input.
Method | Parameters | Description |
---|---|---|
updateSearchQuery | (query: string) | Updates the search query with the provided string. |
Example
You can follow a similar pattern in React to programmatically call the above method.
typescript