npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-elasticsearch

v3.1.0

Published

[![Version](https://img.shields.io/npm/v/react-elasticsearch.svg)](https://npmjs.org/package/react-elasticsearch) [![Downloads](https://img.shields.io/npm/dt/react-elasticsearch.svg)](https://npmjs.org/package/react-elasticsearch) [![License](https://img.

Downloads

6,373

Readme

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