Embedded Search and Chat (React)
Add a toggleable search and chat UI directly on a dedicated page
Overview
This is a toggleable chat / search UI that is directly incorporated into a page instead of within a pop-up modal.
It's a combination of the Embedded Chat and the Embedded Search components, allowing you to toggle between chat and search.
Quick Start
Install the component library
Define the component
Embedded Search Props
This type represents the configuration for the Inkeep embedded search widget.
Prop | Type | Required | Description |
---|---|---|---|
baseSettings | object | Yes | Core configuration settings. See Base Settings for details. |
searchSettings | object | No | Search configuration settings. See Search Settings for details. |
isHidden | boolean | No | Whether to hide the search interface. Defaults to false. |
shouldAutoFocusInput | boolean | No | Whether to auto focus the input. Defaults to true. |
askAILabel | string | No | The label for the Ask AI button in search, also shown in the search/chat toggle |
searchLabel | string | No | The label for the search item in the search/chat toggle. |
Examples
Set the default view
Force the default view
If you want to force the default view to be the search or the chat, you can use the forceDefaultView
property. This is useful to ensure the widget always opens the defaultView instead of last used view.
Refer to the Search Settings and Chat Settings docs for more details on the available properties.
Accessing Component Methods
Exactly how you'd do it in the Embedded Search and Embedded Chat components respectively.
Chat Methods
Method | Description |
---|---|
submitMessage(message?: string) | Programmatically sends a message in chat. If message is omitted, sends the current input value. |
updateInputMessage(message: string) | Updates the text in chat input field |
clearChat() | Resets the chat to its initial state |
openForm(formSettings: FormSettings) | Displays a form overlay in chat interface |
focusInput() | Sets focus to the chat input field |
Refer to the Form Settings reference docs for more details on the available properties for the openForm
method.
Search methods
Method | Description |
---|---|
updateQuery(query: string) | Programmatically updates the search query. |
focusInput() | Sets focus to the search input field |
Widget methods
Method | Description |
---|---|
setView(view: ModalViewTypes) | Set the view of the widget to either search or chat |