"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["52375"],{27121:function(e,r,t){t.r(r),t.d(r,{metadata:()=>a,contentTitle:()=>u,default:()=>p,assets:()=>c,toc:()=>d,frontMatter:()=>s});var a=JSON.parse('{"id":"api/themes/theme-search-algolia","title":"\uD83D\uDCE6 theme-search-algolia","description":"This theme provides a @theme/SearchBar component that integrates with Algolia DocSearch easily. Combined with @docusaurus/theme-classic, it provides a very easy search integration. You can read more on search documentation.","source":"@site/docs/api/themes/theme-search-algolia.mdx","sourceDirName":"api/themes","slug":"/api/themes/@docusaurus/theme-search-algolia","permalink":"/docs/api/themes/@docusaurus/theme-search-algolia","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/api/themes/theme-search-algolia.mdx","tags":[],"version":"current","lastUpdatedBy":"S\xe9bastien Lorber","lastUpdatedAt":1729593657000,"sidebarPosition":4,"frontMatter":{"sidebar_position":4,"slug":"/api/themes/@docusaurus/theme-search-algolia"},"sidebar":"api","previous":{"title":"\uD83D\uDCE6 theme-live-codeblock","permalink":"/docs/api/themes/@docusaurus/theme-live-codeblock"},"next":{"title":"\uD83D\uDCE6 theme-mermaid","permalink":"/docs/api/themes/@docusaurus/theme-mermaid"}}'),n=t("24246"),o=t("80980"),i=t("15398"),l=t("58636");let s={sidebar_position:4,slug:"/api/themes/@docusaurus/theme-search-algolia"},u="\uD83D\uDCE6 theme-search-algolia",c={},d=[];function h(e){let r={a:"a",admonition:"admonition",code:"code",h1:"h1",header:"header",p:"p",pre:"pre",...(0,o.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r.header,{children:(0,n.jsx)(r.h1,{id:"-theme-search-algolia",children:"\uD83D\uDCE6 theme-search-algolia"})}),"\n",(0,n.jsxs)(r.p,{children:["This theme provides a ",(0,n.jsx)(r.code,{children:"@theme/SearchBar"})," component that integrates with Algolia DocSearch easily. Combined with ",(0,n.jsx)(r.code,{children:"@docusaurus/theme-classic"}),", it provides a very easy search integration. You can read more on ",(0,n.jsx)(r.a,{href:"/docs/search",children:"search"})," documentation."]}),"\n",(0,n.jsxs)(i.Z,{groupId:"npm2yarn",children:[(0,n.jsx)(l.Z,{value:"npm",children:(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{className:"language-bash",children:"npm install --save @docusaurus/theme-search-algolia\n"})})}),(0,n.jsx)(l.Z,{value:"yarn",label:"Yarn",children:(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{className:"language-bash",children:"yarn add @docusaurus/theme-search-algolia\n"})})}),(0,n.jsx)(l.Z,{value:"pnpm",label:"pnpm",children:(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{className:"language-bash",children:"pnpm add @docusaurus/theme-search-algolia\n"})})})]}),"\n",(0,n.jsxs)(r.p,{children:["This theme also adds search page available at ",(0,n.jsx)(r.code,{children:"/search"})," (as swizzlable ",(0,n.jsx)(r.code,{children:"SearchPage"})," component) path with OpenSearch support. You can change this default path via ",(0,n.jsx)(r.code,{children:"themeConfig.algolia.searchPagePath"}),". Use ",(0,n.jsx)(r.code,{children:"false"})," to disable search page."]}),"\n",(0,n.jsx)(r.admonition,{type:"tip",children:(0,n.jsxs)(r.p,{children:["If you have installed ",(0,n.jsx)(r.code,{children:"@docusaurus/preset-classic"}),", you don't need to install it as a dependency."]})})]})}function p(e={}){let{wrapper:r}={...(0,o.a)(),...e.components};return r?(0,n.jsx)(r,{...e,children:(0,n.jsx)(h,{...e})}):h(e)}},58636:function(e,r,t){t.d(r,{Z:()=>i});var a=t("24246");t("27378");var n=t("90496");let o="tabItem_pnkT";function i(e){var r=e.children,t=e.hidden,i=e.className;return(0,a.jsx)("div",{role:"tabpanel",className:(0,n.Z)(o,i),hidden:t,children:r})}},15398:function(e,r,t){t.d(r,{Z:()=>S});var a=t("24246"),n=t("27378"),o=t("90496"),i=t("54947"),l=t("3620"),s=t("844"),u=t("97486"),c=t("32263"),d=t("16971");function h(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,a=Array(r);t child <".concat("string"==typeof e.type?e.type:e.type.name,'>: all children of the component should be , and every should have a unique "value" prop.'))}))||void 0===r?void 0:r.filter(Boolean))&&void 0!==t?t:[]}function m(e){var r=e.value;return e.tabValues.some(function(e){return e.value===r})}var b=t("71607");let v="tabList_Qoir",y="tabItem_AQgk";function g(e){for(var r=1;r0)throw Error('Docusaurus error: Duplicate values "'.concat(r.map(function(e){return e.value}).join(", "),'" found in . Every value needs to be unique.'))}(e),e},[t,a])),T=p((0,n.useState)(function(){return function(e){var r,t=e.defaultValue,a=e.tabValues;if(0===a.length)throw Error("Docusaurus error: the component requires at least one children component");if(t){if(!m({value:t,tabValues:a}))throw Error('Docusaurus error: The has a defaultValue "'.concat(t,'" but none of its children has the corresponding value. Available values are: ').concat(a.map(function(e){return e.value}).join(", "),". If you intend to show no default tab, use defaultValue={null} instead."));return t}var n=null!==(r=a.find(function(e){return e.default}))&&void 0!==r?r:a[0];if(!n)throw Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:S,tabValues:I})}),2),V=T[0],E=T[1];var D=p((i=(o={queryString:void 0!==P&&P,groupId:k}).queryString,h=o.groupId,b=(0,l.k6)(),v=function(e){var r=e.queryString,t=void 0!==r&&r,a=e.groupId;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!a)throw Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return null!=a?a:null}({queryString:void 0!==i&&i,groupId:h}),[(0,u._X)(v),(0,n.useCallback)(function(e){if(!!v){var r,t,a=new URLSearchParams(b.location.search);a.set(v,e),b.replace((r=function(e){for(var r=1;r