0.0.59 • Published 8 months ago

trieve-search-component v0.0.59

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

Trieve Search Component

The easiest way to get up and running in your app using trieve search.

How to use

Install using your favorite package manager:

yarn add trieve-search-component
# or
npm install trieve-search-component
# or
pnpm install trieve-search-component

After installing the first step is to instantiate a new TrieveSDK like so:

import { TrieveSDK } from "trieve-ts-sdk";

export const trieve = new TrieveSDK({
  apiKey: "<your-api-key>",
  datasetId: "<dataset-to-use>",
});

And then you can use any of the two components in your React application or as web component:

Search Modal

light closed dark closed light open

Usage in React:

<TrieveModalSearch trieve={trieve} />

Usage in Web Components:

initModalSearch({
  trieve: new TrieveSDK({
    // your options
  })
})


<trieve-modal-search />

If you are using it in JSX environment you will need to add the trieve-modal-search to the JSX attributes, for solid that would be:

declare module "solid-js" {
  namespace JSX {
    interface IntrinsicElements {
      "trieve-modal-search": {};
      "trieve-search": {};
    }
  }
}

Props

NameTypeDefault
datasetIdstring''
apiKeystring''
baseUrlstring"https://api.trieve.ai"
chatbooleantrue
analyticsbooleantrue
placeholderstring"Search..."
onResultClick() => void() => {}
theme"light" or "dark""light"
searchOptionsAutocompleteReqPayload{ search_type: "fulltext" }
openKeyCombination{ key?: string; label?: string; ctrl?: boolean }[]{ ctrl: true }, { key: "k", label: "K" }
ButtonElJSX.ElementTypenull
suggestedQueriesbooleantrue
defaultSearchQueriesstring[][]
defaultAiQuestionsstring[][]
brandLogoImgSrcUrlstringnull
brandNamestringnull
brand Colorstring#CB53EB
problemLinkstringnull
responsivebooleanfalse

Search Results

light dark

Usage in React:

<TrieveSearch apiKey="<your trieve apiKey>" datasetId="<your trieve datasetId" />

Usage in Web Components:

<trieve-search apiKey="<your trieve apiKey>" datasetId="<your trieve datasetId" />

Props

NameTypeDefault
datasetIdstring''
apiKeystring''
placeholderstring"Search..."
onResultClick() => void() => {}
theme"light" or "dark""light"
searchOptionsSearchChunksReqPayload{ search_type: "hybrid" }

License

MIT

Development Guide

The example/ folder shows the example application for what rendering this would look like

Start the listener to update the search-component's css and javascript

$clients/search-component yarn
$clients/search-component yarn dev

Run the example application

$clients/search-component cd example/
$clients/search-component yarn
$clients/search-component yarn dev
0.0.59

8 months ago

0.0.58

8 months ago

0.0.52

8 months ago

0.0.53

8 months ago

0.0.54

8 months ago

0.0.55

8 months ago

0.0.56

8 months ago

0.0.57

8 months ago

0.0.47

8 months ago

0.0.51

8 months ago

0.0.50

8 months ago

0.0.48

8 months ago

0.0.49

8 months ago

0.0.46

8 months ago

0.0.45

8 months ago

0.0.44

8 months ago

0.0.43

8 months ago

0.0.42

8 months ago

0.0.41

8 months ago

0.0.40

8 months ago

0.0.39

8 months ago

0.0.38

8 months ago

0.0.37

8 months ago

0.0.36

8 months ago

0.0.35

8 months ago

0.0.34

8 months ago

0.0.33

8 months ago

0.0.32

8 months ago

0.0.31

8 months ago

0.0.30

8 months ago

0.0.29

8 months ago

0.0.23

8 months ago

0.0.22

8 months ago

0.0.21

8 months ago

0.0.20

8 months ago

0.0.19

9 months ago

0.0.18

9 months ago

0.0.17

9 months ago

0.0.16

9 months ago

0.0.15

9 months ago

0.0.14

9 months ago

0.0.13

9 months ago

0.0.12

9 months ago

0.0.11

9 months ago

0.0.10

9 months ago

0.0.9

9 months ago

0.0.8

9 months ago

0.0.7

9 months ago

0.0.6

9 months ago

0.0.5

9 months ago

0.0.4

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago

0.0.1-rc8

9 months ago

0.0.1-rc7

9 months ago

0.0.1-rc6

9 months ago

0.0.1-rc5

9 months ago

0.0.1-rc4

10 months ago

0.0.1-rc3

10 months ago

0.0.1-rc2

10 months ago

0.0.1-rc1

10 months ago