casted-react-search

1.1.7 • Public • Published

casted-react-search

A React component to search Casted account content

NPM JavaScript Style Guide

Install

npm install --save casted-react-search

Usage

import React, { useState } from 'react'

import { SearchInput, SearchResults } from 'casted-react-search'
import 'casted-react-search/dist/index.css'

const ExampleComponent = () => {
  const [isSearchOpen, setIsSearchOpen] = useState(false)

  // The history value should be pulled in from router library
  const history = null

  return (
    <>
      <SearchInput onClick={() => setIsSearchOpen(true)} />
      <SearchResults
        searchKey='elastic-search-key'
        engineName='elastic-engine-name'
        endpointBase='elastic-endpoint-base'
        history={history}
        onResultClick={() => setIsSearchOpen(false)}
      />
    </>
  )
}

Development

When needing to develop this library, you can utilize the test environment located in /example. The test environment will automatically pull in the casted-react-search library.

To build casted-react-search, run:

npm run build

To build and watch casted-react-search, run:

npm run start

License

MIT © maindaniel

Readme

Keywords

none

Package Sidebar

Install

npm i casted-react-search

Weekly Downloads

1

Version

1.1.7

License

MIT

Unpacked Size

441 kB

Total Files

8

Last publish

Collaborators

  • casted_josh
  • maindaniel
  • zsimps692
  • casted_dev