0.1.1 • Published 2 years ago

@hackney/social-care-search v0.1.1

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

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.

0.1.1

2 years ago

0.1.0

2 years ago