diff --git a/docs/guides-search.md b/docs/guides-search.md index 7e9424813928..b15630fac8b9 100644 --- a/docs/guides-search.md +++ b/docs/guides-search.md @@ -61,6 +61,20 @@ const siteConfig = { }; ``` +## Customizing the placeholder + +If you want to change the placeholder (which defaults to *Search*), add the `placeholder` field in your config. For example, you may want the search bar to display *Ask me something*: + +```js +const siteConfig = { + ... + algolia: { + ... + placeholder: 'Ask me something' + }, +}; +``` + ## Disabling the Search Bar To disable the search bar, comment out (recommended) or delete the `algolia` section in the `siteConfig.js` file. diff --git a/v1/lib/core/nav/HeaderNav.js b/v1/lib/core/nav/HeaderNav.js index 75cdb5e337aa..177a84ce0f5b 100644 --- a/v1/lib/core/nav/HeaderNav.js +++ b/v1/lib/core/nav/HeaderNav.js @@ -131,13 +131,14 @@ class HeaderNav extends React.Component { let docGroupActive = false; if (link.search && this.props.config.algolia) { // return algolia search bar + const placeholder = this.props.config.algolia.placeholder || 'Search'; return (
  • );