* feat(sidepanel): Add sidepanel component for Ask AI (#2792) * feat(sidepanel): Initial working Sidepanel implementation * fix: circleci config * fix: set proper sidepanel export * Sidepanel props updates, conversation screen updates * Started mobile work * Style prompt input and header for mobile * fixes prompt input height, adds more translations, mobile updates, fixes panel height calculations * finish mobile, adds dark theme, minor fixes * fix: lock * Add missing titles to buttons * Have most recent conversation be at the bottom of the exchange list, scroll to newest conversation * fix: versions * move to floating variant being default for Sidepanel --------- Co-authored-by: Dylan Tientcheu <dylantientcheu@gmail.com> * feat(sidepanel): Sidepanel/Modal hybrid mode (#2799) * feat(sidepanel): Initial working Sidepanel implementation * fix: circleci config * fix: set proper sidepanel export * Sidepanel props updates, conversation screen updates * Started mobile work * Style prompt input and header for mobile * fixes prompt input height, adds more translations, mobile updates, fixes panel height calculations * finish mobile, adds dark theme, minor fixes * fix: lock * Add missing titles to buttons * Have most recent conversation be at the bottom of the exchange list, scroll to newest conversation * feat(sidepanel): Allow hybrid mode for Sidepanel and Modal * fix: yarn.lock * fix: tests - dont send new chat message from modal while in hybrid mode * Make docsearch core a true dependency * Cleanup handling the registered views Set --------- Co-authored-by: Dylan Tientcheu <dylantientcheu@gmail.com> * feat(sidepanel): Add sidepanel-js package for CDN (#2800) * feat(sidepanel): Initial working Sidepanel implementation * fix: circleci config * fix: set proper sidepanel export * Sidepanel props updates, conversation screen updates * Started mobile work * Style prompt input and header for mobile * fixes prompt input height, adds more translations, mobile updates, fixes panel height calculations * finish mobile, adds dark theme, minor fixes * fix: lock * Add missing titles to buttons * Have most recent conversation be at the bottom of the exchange list, scroll to newest conversation * feat(sidepanel): Add sidepanel-js package for CDN * fix: ci * fix: yarn.lock --------- Co-authored-by: Dylan Tientcheu <dylantientcheu@gmail.com> * feat(sidepanel): Sidepanel UI/UX tweaks (#2808) * fix(umd): Fixes global names for packages in UMD builds * chore: Update tsdeclaration files, update directory field in package json files * feat(sidepanel): Add Sidepanel documentation (#2811) * feat(sidepanel): Add Sidepanel documentation * Minor fixes and updates * Hybrid mode update * fix: hardcode yarn cache key for now --------- Co-authored-by: Dylan Tientcheu <dylantientcheu@gmail.com>
136 lines
2.8 KiB
Text
136 lines
2.8 KiB
Text
---
|
|
title: Get started with Sidepanel
|
|
---
|
|
|
|
import Tabs from '@theme/Tabs';
|
|
import TabItem from '@theme/TabItem';
|
|
|
|
:::info
|
|
Sidepanel is available from version `>= 4.4`
|
|
:::
|
|
|
|
## Introduction
|
|
|
|
DocSearch Sidepanel is a new experience separate from the DocSearch Modal experience. Sidepanel is built entirely for usage with Ask AI and can be used completely standalone or in [Hybrid mode][1] with the Modal.
|
|
|
|
## Installation
|
|
|
|
To get started with Sidepanel, first you will need to install the needed packages:
|
|
|
|
<Tabs>
|
|
<TabItem value="npm">
|
|
|
|
```bash
|
|
npm install @docsearch/react @docsearch/css
|
|
|
|
# Or if using JS based package
|
|
|
|
npm install @docsearch/sidepanel-js @docsearch/css
|
|
```
|
|
|
|
</TabItem>
|
|
|
|
<TabItem value="yarn">
|
|
|
|
```bash
|
|
yarn add @docsearch/react @docsearch/css
|
|
|
|
# Or if using JS based package
|
|
|
|
yarn add @docsearch/sidepanel-js @docsearch/css
|
|
```
|
|
|
|
</TabItem>
|
|
|
|
<TabItem value="pnpm">
|
|
|
|
```bash
|
|
pnpm add @docsearch/react @docsearch/css
|
|
|
|
# Or if using JS based package
|
|
|
|
pnpm add @docsearch/sidepanel-js @docsearch/css
|
|
```
|
|
|
|
</TabItem>
|
|
|
|
<TabItem value="bun">
|
|
|
|
```bash
|
|
bun add @docsearch/react @docsearch/css
|
|
|
|
# Or if using JS based package
|
|
|
|
bun add @docsearch/sidepanel-js @docsearch/css
|
|
```
|
|
|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
> Or using your package manager of choice
|
|
|
|
### Without package manager
|
|
|
|
```html
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css/dist/style.css" />
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css/dist/sidepanel.css" />
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/@docsearch/sidepanel-js"></script>
|
|
```
|
|
|
|
## Implementation
|
|
|
|
The simplest implementation of Sidepanel would be as follows:
|
|
|
|
<Tabs>
|
|
<TabItem value="React">
|
|
```tsx
|
|
import { DocSearchSidepanel } from '@docsearch/react/sidepanel';
|
|
|
|
import '@docsearch/css/dist/style.css';
|
|
import '@docsearch/css/dist/sidepanel.css';
|
|
|
|
function App() {
|
|
return (
|
|
<DocSearchSidepanel
|
|
appId='YOUR_APP_ID'
|
|
apiKey='YOUR_SEARCH_API_KEY'
|
|
assistantId='YOUR_ASSISTANT_ID'
|
|
indexName='YOUR_INDEX_NAME'
|
|
/>
|
|
);
|
|
}
|
|
```
|
|
</TabItem>
|
|
|
|
<TabItem value="JavaScript">
|
|
You will need a `container` DOM node to render the Sidepanel into:
|
|
|
|
```html
|
|
<div id="docsearch-sidepanel"></div>
|
|
```
|
|
|
|
```js
|
|
import sidepanel from '@docsearch/sidepanel-js';
|
|
|
|
import '@docsearch/css/dist/style.css';
|
|
import '@docsearch/css/dist/sidepanel.css';
|
|
|
|
sidepanel({
|
|
container: '#docsearch-sidepanel',
|
|
indexName: 'YOUR_INDEX_NAME',
|
|
appId: 'YOUR_APP_ID',
|
|
apiKey: 'YOUR_SEARCH_API_KEY',
|
|
assistantId: 'YOUR_ASSISTANT_ID',
|
|
});
|
|
```
|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
This is just the most basic form of implementation. To learn about other implementation methods, you can read our [Advanced use cases][2].
|
|
|
|
To learn more about the different configuration options for Sidepanel, you can read our [Sidepanel API References][3]
|
|
|
|
[1]: /docs/sidepanel/hybrid
|
|
[2]: /docs/sidepanel/advanced-use-cases
|
|
[3]: /docs/sidepanel/api-reference
|