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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@kit-data-manager/react-search-component

v0.3.0

Published

All-in-one component for rendering an elastic search UI for searching anything. Built-in support for visualizing related items in a graph and resolving unique identifiers.

Downloads

135

Readme

react-search-component

Static Badge Node.js CI NPM Type Definitions

All-in-one, highly configurable React component for rendering an elastic search UI based on the provided configuration. Includes an interactive graph of related records and unique identifier resolving.

Fair Digital Objects
This component includes some useful (optional) features for FAIR DOs

This is an ESM Module intended for use in modern React applications. Make sure your bundler supports importing CSS files in JavaScript/TypeScript. Next.js is supported out of the box.

Installation

  npm install @kit-data-manager/react-search-component

Docs

Visit the Storybook for examples and some documentation. For more documentation, consult the TypeScript typings.

Quick Start

Refer to the Getting Started Guide in the Storybook

Customization

Result View

Most notably, the result view component should be customized. A GenericResultView Component is provided that should work for some scenarious out of the box. Otherwise, you should implement your own Result View in React. For a starting point, feel free to copy the code of GenericResultView.ts, though most of the customization should be thrown out to make it more lightweight.

Generic Result View

Each field of the generic result view can be mapped to a field in the elastic search index. Additionally, you can specify multiple tags from multiple different fields in the elastic index. Take a look at the Storybook for an example.

To map (parts of) the result before feeding it to the GenericResultView, you can define you own component that itself uses the GenericResultView with modified data:

import { useMemo } from "react"
import { GenericResultView, ResultViewProps } from "@kit-data-manager/react-search-component"

export function MyResultView(props: ResultViewProps) {
    const mappedResult = useMemo(() => {
        const copy = structuredClone(props.result)
        copy.someProperty = copy.something + copy.somethingElse
        return copy
    }, [props.result])

    return <GenericResultView result={mappedResult} titleField={"someProperty"} />
}

Then simply pass your custom component to the search component.

Styling

Styling is done using tailwind and css variables. Feel free to override these variables in your own CSS. More information can be found in the Storybook.

Contributing

Feedback and issue reports are welcome, simply create an issue here on GitHub.

Development

Install dependencies with

    npm install

Run development server with

    npm run storybook:dev