0.0.59 • Published 9 months ago

trieve-search-component v0.0.59

Weekly downloads
-
License
MIT
Repository
-
Last release
9 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

9 months ago

0.0.58

9 months ago

0.0.52

9 months ago

0.0.53

9 months ago

0.0.54

9 months ago

0.0.55

9 months ago

0.0.56

9 months ago

0.0.57

9 months ago

0.0.47

9 months ago

0.0.51

9 months ago

0.0.50

9 months ago

0.0.48

9 months ago

0.0.49

9 months ago

0.0.46

9 months ago

0.0.45

9 months ago

0.0.44

9 months ago

0.0.43

9 months ago

0.0.42

9 months ago

0.0.41

9 months ago

0.0.40

9 months ago

0.0.39

9 months ago

0.0.38

9 months ago

0.0.37

9 months ago

0.0.36

9 months ago

0.0.35

9 months ago

0.0.34

9 months ago

0.0.33

9 months ago

0.0.32

9 months ago

0.0.31

9 months ago

0.0.30

9 months ago

0.0.29

9 months ago

0.0.23

9 months ago

0.0.22

9 months ago

0.0.21

9 months ago

0.0.20

9 months ago

0.0.19

10 months ago

0.0.18

10 months ago

0.0.17

10 months ago

0.0.16

10 months ago

0.0.15

10 months ago

0.0.14

10 months ago

0.0.13

10 months ago

0.0.12

10 months ago

0.0.11

10 months ago

0.0.10

10 months ago

0.0.9

10 months ago

0.0.8

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1-rc8

10 months ago

0.0.1-rc7

10 months ago

0.0.1-rc6

10 months ago

0.0.1-rc5

10 months ago

0.0.1-rc4

11 months ago

0.0.1-rc3

11 months ago

0.0.1-rc2

11 months ago

0.0.1-rc1

11 months ago