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-custom-search-list

v1.0.1

Published

A customizable React search input component with dynamic popup suggestions, allowing developers to create unique search experiences.

Downloads

126

Readme

react-custom-search-list

React Custom Search List is a powerful and flexible search input component for React. It allows developers to create a fully customizable suggestions list that can display regardless of the current input. The component enhances user experience by providing instant visual feedback through dynamic popups, enabling users to seamlessly type and select from tailored search suggestions.

Whether you want to showcase a constant list of options or dynamically adapt to user inputs, React Custom Search List offers the versatility you need to deliver an engaging search experience.

Features

  • Dynamic suggestions list

  • Responsive

  • Clear button

  • Rtl support

  • Flexible style

Installation

$ npm install react-custom-search-list --save

or

$ yarn add react-custom-search-list

If you need to directly include script in your html, use the following links :

<script src="https://unpkg.com/react-custom-search-list@latest/dist/react-custom-search-list.umd.min.js"></script>

Minimal Usage

import {useState} from 'react';
import ReactCustomSearchList from 'react-custom-search-list';
function App() {
  const [searchValue, setSearchValue] = useState('');
  return (
    <ReactCustomSearchList fullWidth value={searchValue} setValue={setSearchValue}>
      /**Render your suggestions list here */
      <ul>
        <li>Option A</li>
        <li>Option B</li>
        <li>Option C</li>
      </ul>
    </ReactCustomSearchList>
  );
}

Props

  • value
    • type : String
    • description : input value
  • setValue
    • type : Func
    • description : setState function for input value
  • children
    • type : ReactNode
    • description : suggestions list
  • rootStyle?
    • type : Object
    • description : style object of the root element
  • inputStyle?
    • type : Object
    • description : style object of the input element
  • placeholder?
    • type : String
    • default : "search"
  • iconsColor?
    • type : String
    • description : svg icon's color
    • default : "gray"
  • searchIconStyle?
    • type : Object
    • description : style object of the magnifying icon
  • clearIconStyle?
    • type : Object
    • description : style object of the clear icon
  • popperStyle?
    • type : Object
    • description : style object of the popper container
  • onKeyDown?
    • type : Func
    • description : keydown event for input
  • onBlur?
    • type : Func
    • description : blur event for input
  • fullWidth?
    • type : Boolean
    • description : set popper width same as input
  • placement?
    • type : 'auto'| 'auto-start'| 'auto-end'| 'top'| 'top-start'| 'top-end'| 'bottom'| 'bottom-start'| 'bottom-end'| 'right'| 'right-start'| 'right-end'| 'left'| 'left-start'| 'left-end'
    • description : popper's placement

Test

$ npm run test

License

MIT