0.0.5 • Published 6 years ago
@wildpow/datocms-search v0.0.5
DatoCMS site search for ⚛️
DatoCMS Site Search is a way to deliver tailored search results to your site visitors. You can think of it as a replacement for the now discontinued Google Site Search.
This is based on DatoCMS's existing search repo found here
Installation
npm install @wildpow/datocms-search
oryarn install @wildpow/datocms-search
Usage
import React from "react";
import { SearchComponent, DatoCmsSearch } from "@wildpow/datocms-search";
const App = () => {
const client = new DatoCmsSearch("YOUR_API_TOKEN_HERE", "production");
return (
<div>
<SearchComponent client={client} />
</div>
);
};
Props | Type | Default | Description |
---|---|---|---|
client | class instance | undefined | new class instance of DatoCmsSearch passing your API key |
perPage | number | undefined | Number of search resaults per page |
initialQuery | string | undefined | Initial query passed into search widget |
locales | array | undefined | [{ label: "English", value: "en" }, { label: "Italian", value: "it" }] |
initialLocale | String | undefined | 2 letter value of default display language |