react-elasticsearch

3.1.0 • Public • Published

React Elasticsearch

Version Downloads License

UI components for React + Elasticsearch. Create search applications using declarative components.

Usage

👉 Documentation and playable demo available here.

const MySearchComponent = () => (
  <Elasticsearch url="http://example.org/search">
    <SearchBox id="mainSearch" />
    <Facet id="actors" fields={["actors"]} />
    <Facet id="releasedYear" fields={["releasedYear"]} />
    <Results
      id="results"
      items={data =>
        // Map on result hits and display whatever you want.
        data.map(item => <MyCardItem key={item._id} source={item._source} />)
      }
    />
  </Elasticsearch>
);

Install

npm i react-elasticsearch
yarn add react-elasticsearch

Develop

You can test components with storybook (20+ examples).

npm run storybook

Main features

  • 🏝 Released under MIT licence.
  • 👩‍🎨 Each component is built with React and is customisable. Not too much extra features nor magic.
  • 💅 It comes with no style so it's the developers responsibility to implement their own.
  • 🐿 35.32KB gzipped for the whole lib, compatible with old browsers: >0.03% usage.
  • 🔮 No legacy: created in 2019, updated in 2021 with hooks.

Why?

We started building the search experience of the french Cultural Heritage Open Platform with ReactiveSearch, a well-known search UI components lib for React. After some weeks, we realized we had spent a lot of time tweaking and hacking the lib; we had rewrote almost every components ourselves. We opened issues and pull requests on the repository, but it seemed the lib was a bit stuck in a rewrite process. We found out that we need a simple lib that can be easily extended with a similar API, we created this one. This lib has many less feature than others, it's not even a decent competitor. But since it helped us building a search experiences, it has been released. Hope it could help you!

Contributing

Open issues and PR here: https://github.com/betagouv/react-elasticsearch

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
3.1.01,025latest

Version History

VersionDownloads (Last 7 Days)Published
3.1.01,025
3.0.20
3.0.10
3.0.00
2.0.07
1.23.00
1.22.42
1.22.30
1.22.21
1.22.10
1.22.01
1.21.40
1.21.30
1.21.20
1.21.10
1.21.00
1.20.01
1.19.00
1.18.30
1.18.20
1.18.12
1.18.00
1.17.21
1.17.10
1.17.01
1.16.10
1.16.01
1.15.90
1.15.80
1.15.71
1.15.60
1.15.50
1.15.42
1.15.30
1.15.20
1.15.10
1.15.00
1.14.00
1.13.00
1.12.00
1.11.01
1.10.10
1.10.00
1.9.00
1.8.00
1.7.00
1.6.00
1.5.00
1.4.00
1.3.01
1.2.00

Package Sidebar

Install

npm i react-elasticsearch

Weekly Downloads

1,047

Version

3.1.0

License

MIT

Unpacked Size

219 kB

Total Files

32

Last publish

Collaborators

  • rap2hpoutre
  • goffle