Last updated

search

By default, search is added to your project in the top navigation bar in the far right side corner. You can use the search configuration to customize search in the following ways:

  • hide the search bar
  • add a list of shortcuts for activating search
  • add a list of suggested pages to the search modal

Options

OptionTypeDescription
hidebooleanSpecifies if the search bar should be hidden. Default: false.
shortcuts[string]List of keyboard shortcuts to activate search (for example, ctrl+f). Default: /.
suggestedPages[Page item]List of suggested pages.

Page item object

OptionTypeDescription
pagestringREQUIRED. Path to the file which represents the page to link to.
labelstringLink text displayed for the item.
labelTranslationKeystringLink text key for the item used for localization.

Examples

The following configuration hides the search bar.

search:
  hide: true

The following configuration sets keyboard shortcuts that trigger search:

search:
  shortcuts:
    - ctrl+f
    - cmd+k
    - /

The following configuration sets suggested pages for the search modal window:

search:
  suggestedPages:
    - label: Home page
      page: index.page.tsx
    - page: /catalog/
  • Learn more about the options for adding translated content in the l10n reference documentation.
  • Find other options for adding items to the top navigation menu in the navbar reference documentation.

Resources