SearchView

A component that renders a search view, with input field and search reuslts.

Basic example

1import { SearchView } from '@markprompt/react';
2
3function Example() {
4  return (
5    <SearchView
6      projectKey="YOUR-PROJECT-KEY"
7      searchOptions={{ placeholder: 'Search docs' }}
8    />
9  );
10}

Component API

Prop Type Description Default
apiUrl string

The base API URL.

projectKey string

The project key associated to the project.

activeView View

The active view.

onDidSelectResult () => void

Callback when a search result is selected.

onDidSelectAsk (query?: string) => void

Callback when chat is selected.

layout MarkpromptOptions['layout']

Multi-pane layout when both search and chat are enabled.

"panels"
searchOptions SubmitSearchQueryOptions & SearchOptions

Options for the search component.

linkAs MarkpromptOptions['linkAs']

Component to use in place of <a>.

"a"
debug boolean

Display debug info.

false