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 🙏

© 2026 – Pkg Stats / Ryan Hefner

drop-search

v1.0.1

Published

A searchable dropdown supporting single, multi, and checkbox modes.

Readme

drop-search

A lightweight, searchable dropdown component for React supporting single-select, multi-select, and checkbox modes. Highly customizable with CSS variables and sub-component targeting.

Installation

npm install drop-search

Usage

Basic React Example

import { DropSearch } from 'drop-search';
import 'drop-search/dist/index.css';

const countries = [
  { label: 'Ghana', value: 'GH' },
  { label: 'United Kingdom', value: 'UK' },
];

function App() {
  return (
    <DropSearch 
      data={countries} 
      mode="multi" 
      onSelect={(selected) => console.log(selected)} 
    />
  );
}

Next.js Usage

drop-search is fully compatible with Next.js (App Router and Pages Router).

App Router (Server Components)

Since drop-search uses React hooks, it is marked with "use client". You can import it directly into your Server Components:

// app/page.tsx
import { DropSearch } from 'drop-search';
import 'drop-search/dist/index.css';

export default function Page() {
  const data = [{ label: 'Option 1', value: 1 }];
  
  return (
    <main>
      <h1>My Next.js App</h1>
      <DropSearch data={data} />
    </main>
  );
}

Styling in Next.js

Ensure you import the CSS in your layout.tsx or _app.tsx for global availability, or locally in your component as shown above.

Customization

drop-search is designed to be easily themed.

1. Using CSS Variables

You can override the default theme by setting these variables in your global CSS:

:root {
  --drop-search-primary: #10b981; /* Emerald */
  --drop-search-radius: 0px;      /* Square corners */
  --drop-search-bg: #f3f4f6;
}

2. Using classNames Prop

Target specific parts of the component for custom styling:

<DropSearch
  data={data}
  classNames={{
    trigger: 'my-custom-trigger-class',
    item: 'hover:bg-green-100',
    panel: 'shadow-2xl'
  }}
/>

Available classNames keys: container, trigger, selection, placeholder, badge, badgeRemove, panel, searchArea, input, list, item, checkbox, empty.

3. Using style Prop

Pass an inline style object to the main container:

<DropSearch data={data} style={{ maxWidth: '400px' }} />

Props

| Prop | Type | Default | Description | | :--- | :--- | :--- | :--- | | data | Option[] | [] | Array of { label: string, value: any } | | mode | 'single' \| 'multi' \| 'checkbox' | 'single' | Selection mode | | placeholder | string | 'Search...' | Placeholder text | | onSelect | (value: any) => void | - | Callback when selection changes | | className | string | '' | Additional class for container | | classNames | object | {} | Classes for sub-components | | style | React.CSSProperties | - | Inline styles for container |

License

MIT © Felix Kwamena Awortwe