|
1 | 1 | # react-instantsearch-hooks-web |
2 | 2 |
|
3 | | -> 🚧 This version is not yet production-ready. |
| 3 | +React InstantSearch Hooks Web is an open-source React library that lets you create an instant search result experience using [Algolia][algolia-website]’s search API. It is part of the InstantSearch family: |
| 4 | + |
| 5 | +**React InstantSearch** | [InstantSearch.js][instantsearch.js-github] | [Angular InstantSearch][instantsearch-angular-github] | [Vue InstantSearch][instantsearch-vue-github] | [InstantSearch Android][instantsearch-android-github] | [InstantSearch iOS][instantsearch-ios-github] |
| 6 | + |
| 7 | +## Why |
| 8 | + |
| 9 | +You should be using React InstantSearch Hooks Web if you want to: |
| 10 | + |
| 11 | +* Design search experiences with best practices |
| 12 | +* Customize your components at will |
| 13 | +* Follow React principles |
| 14 | + |
| 15 | +## Installation |
| 16 | + |
| 17 | +React InstantSearch is available on the npm registry. It relies on [`algoliasearch`](https://github.com/algolia/algoliasearch-client-javascript) to communicate with Algolia APIs. |
| 18 | + |
| 19 | +```sh |
| 20 | +yarn add algoliasearch react-instantsearch-hooks-web |
| 21 | +# or |
| 22 | +npm install algoliasearch react-instantsearch-hooks-web |
| 23 | +``` |
| 24 | + |
| 25 | +## Getting started |
| 26 | + |
| 27 | +Using React InstantSearch Hooks Web is as simple as adding these components to your app: |
| 28 | + |
| 29 | +```javascript |
| 30 | +import React from 'react'; |
| 31 | +import ReactDOM from 'react-dom'; |
| 32 | +import algoliasearch from 'algoliasearch/lite'; |
| 33 | +import { InstantSearch, SearchBox, Hits } from 'react-instantsearch-hooks-web'; |
| 34 | + |
| 35 | +const searchClient = algoliasearch( |
| 36 | + 'latency', |
| 37 | + '6be0576ff61c053d5f9a3225e2a90f76' |
| 38 | +); |
| 39 | + |
| 40 | +const App = () => ( |
| 41 | + <InstantSearch |
| 42 | + indexName="bestbuy" |
| 43 | + searchClient={searchClient} |
| 44 | + > |
| 45 | + <SearchBox /> |
| 46 | + <Hits /> |
| 47 | + </InstantSearch> |
| 48 | +); |
| 49 | +``` |
| 50 | + |
| 51 | +<p align="center"> |
| 52 | + <a href="https://codesandbox.io/s/github/algolia/react-instantsearch/tree/master/examples/hooks" title="Edit on CodeSandbox"> |
| 53 | + <img alt="Edit on CodeSandbox" src="https://codesandbox.io/static/img/play-codesandbox.svg"> |
| 54 | + </a> |
| 55 | +</p> |
| 56 | + |
| 57 | +To learn more about the library, follow the [getting started guide][doc-getting-started]. |
| 58 | + |
| 59 | +## Documentation |
| 60 | + |
| 61 | +The documentation is available on [algolia.com/doc][doc]. |
| 62 | + |
| 63 | +## Playground |
| 64 | + |
| 65 | +You can get to know React InstantSearch on [this playground][doc-playground]. |
| 66 | + |
| 67 | +Start by [adding components][doc-getting-started] and tweaking the display. Once you get more familiar with the library, you can learn more advanced concepts in [our guides][doc-guides]. |
| 68 | + |
| 69 | +## Contributing |
| 70 | + |
| 71 | +We welcome all contributors, from casual to regular. You are only one command away to start the developer environment, [read our CONTRIBUTING guide](https://github.com/algolia/react-instantsearch/blob/master/CONTRIBUTING.md). |
| 72 | + |
| 73 | +## License |
| 74 | + |
| 75 | +React InstantSearch Hooks is [MIT licensed](../../LICENSE). |
| 76 | + |
| 77 | +<!-- Links --> |
| 78 | + |
| 79 | +[doc]: https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/react-hooks/ |
| 80 | +[doc-getting-started]: https://www.algolia.com/doc/guides/building-search-ui/getting-started/react-hooks/ |
| 81 | +[doc-guides]: https://www.algolia.com/doc/guides/building-search-ui/going-further/server-side-rendering/react-hooks/ |
| 82 | +[doc-playground]: https://codesandbox.io/s/github/algolia/react-instantsearch/tree/master/examples/hooks |
| 83 | +[algolia-website]: https://www.algolia.com/ |
| 84 | +[instantsearch.js-github]: https://github.com/algolia/instantsearch.js |
| 85 | +[instantsearch-android-github]: https://github.com/algolia/instantsearch-android |
| 86 | +[instantsearch-ios-github]: https://github.com/algolia/instantsearch-ios |
| 87 | +[instantsearch-vue-github]: https://github.com/algolia/vue-instantsearch |
| 88 | +[instantsearch-angular-github]: https://github.com/algolia/angular-instantsearch |
0 commit comments