@hackney/social-care-search
v0.1.1
Published
Reusable front-end search components for Hackney's social care programme
Downloads
6
Keywords
Readme
LBH Social care search
Reusable front-end components for front-end search.
It contains:
- some TypeScript enums and interfaces to make it easier to work with search
- a
useSearch
hook that connects up to the api and makes it easier to fetch and manage your results - a
<SearchBox/>
component, looking like this, which will let you search any kind of results (or all of them) and return autocomplete suggestions, or just send the user to the results page - a
<SearchBoxHeader/>
component, which wraps the preceding component in a wrapper that means it can be added to our apps as a header link, giving us a much better unified nav experience
Getting started
First, install it:
npm i @hackney/social-care-search
And you can import the components like:
import { SearchBox } from "@hackney/social-care-search"
import { SearchBoxHeader } from "@hackney/social-care-search"
import { useSearch } from "@hackney/social-care-search"
You will need URLs for the search API and/or the search results page, which are passed as props to most components.