Skip to content

Commit 4b9fdba

Browse files
LorrisSaintGenezNatanTechofNYdylantientcheu
authored
chore: add sidepanel example + update top banner on website (#2873)
Co-authored-by: Natan Yagudayev <natanyagudayev@gmail.com> Co-authored-by: Dylan Tientcheu <dylan.tientcheu@algolia.com>
1 parent 45ba8d2 commit 4b9fdba

3 files changed

Lines changed: 32 additions & 3 deletions

File tree

packages/website/docs/examples.mdx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ description: live demos showing how to use and extend docsearch beyond documenta
55
---
66

77
import { DocSearch } from '@docsearch/react';
8+
import { DocSearchSidepanel } from '@docsearch/react/sidepanel';
9+
import BrowserOnly from '@docusaurus/BrowserOnly';
810
import '@docsearch/css/dist/style.css';
11+
import '@docsearch/css/dist/sidepanel.css';
912

1013
> These examples are interactive. click a button to open the modal and try a query.
1114
@@ -69,6 +72,32 @@ Add algolia askai to get synthesized answers grounded in your indexed content. y
6972

7073
---
7174

75+
## Sidepanel: persistent AI chat
76+
77+
The sidepanel provides a persistent chat interface anchored to the side of the page, ideal for documentation sites where users want to ask follow-up questions without losing their place. Look for the button on the bottom right of the screen to try the demo.
78+
79+
```jsx
80+
<DocSearchSidepanel
81+
appId="PMZUYBQDAK"
82+
apiKey="24b09689d5b4223813d9b8e48563c8f6"
83+
indexName="docsearch"
84+
assistantId="askAIDemo"
85+
/>
86+
```
87+
88+
<BrowserOnly>
89+
{() => (
90+
<DocSearchSidepanel
91+
appId="PMZUYBQDAK"
92+
apiKey="24b09689d5b4223813d9b8e48563c8f6"
93+
indexName="docsearch"
94+
assistantId="askAIDemo"
95+
/>
96+
)}
97+
</BrowserOnly>
98+
99+
---
100+
72101
## Custom hit rendering (`hitComponent`)
73102

74103
Replace the default hit markup to match your brand and layout. below is a minimal example of a custom component.

packages/website/docusaurus.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export default {
136136
announcementBar: {
137137
id: 'announcement-bar',
138138
content:
139-
'🚀 Get Ask AI now! Turn your docs site search into an AI-powered assistant – faster answers, fewer tickets, better self-serve. <a target="_blank" rel="noopener noreferrer" href="https://dashboard.algolia.com/ask-ai">Get Started Now</a>',
139+
'Ask AI is now part of <strong>Agent Studio</strong> - We\'re integrating Ask AI into Agent Studio, our centralized space to build and manage AI agents.<a target="_blank" rel="noopener noreferrer" href="https://www.algolia.com/doc/guides/algolia-ai/agent-studio">Explore Agent Studio</a>',
140140
},
141141
colorMode: {
142142
defaultMode: 'light',

packages/website/src/css/custom.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,12 +287,12 @@ html[data-theme='dark'] .docusaurus-highlight-code-line {
287287
/* hide on mobile */
288288
.theme-announcement-bar {
289289
z-index: 100;
290-
min-height: 3rem !important;
290+
min-height: 4rem !important;
291291
font-size: 1.1rem !important;
292292
font-family: 'Sora', sans-serif !important;
293293
font-weight: 400 !important;
294294
line-height: 1.5;
295-
padding: 0.5rem 1rem !important;
295+
padding: 0.75rem 1rem !important;
296296
background-color: var(--ifm-announcement-bar-background-color) !important;
297297
color: #fff !important;
298298
white-space: normal !important; /* Allow text to wrap */

0 commit comments

Comments
 (0)