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

jb-searchbar

v3.0.2

Published

searchbar web component

Readme

jb-searchbar

minimalistic customizable search bar web-component for adding filter options in minimum space sample:https://codepen.io/javadbat/pen/rNjrZpy

  • support every form element as a filter element.

  • normal filter beside extra filter.

  • you can select a filter more than once.

  • compact and user-friendly

  • dom base so it's easy to initiate and you dont need to pass complicated config to make it work.

usage

npm i jb-searchbar
import 'jb-searchbar';
<jb-searchbar></jb-searchbar>

How it works:

After version 3 JBSearchbar has a Major Refactor and now it support 2 kind of filters.

  • filters: normal filters element just rendered inside a bar without any extra job.
  • extra filters: filters that hidden by default. and listed in a drop down. if user choose them they will be rendered and value collected.

filters

Easy, just put filter dom inside filter slot:

<jb-searchbar>
  <div slot="filter">
    <jb-input name="firstName" />
    <jb-input name="lastName" />
    <jb-number-input name="age" />
  </div>
</jb-searchbar>

Extra filter:

Extra filter are the filters that user choose to be added to the filter bar. in this type we analyze children dom of jb-extra-filter and extract labels and input dom from them.

<jb-searchbar>
  <jb-extra-filter>
    <jb-input name="firstName" label="first name" />
    <!-- or -->
    <jb-input name="firstName" data-label="first name" />
    <jb-input name="lastName" data-label="last name"/>
    <jb-number-input name="age" data-label="age"/>
  </jb-extra-filter>
</jb-searchbar>

you can use label attribute or data-label attribute if you dont want to set real label attribute of the component.

data-max-count

this attribute define how many times user can select that filter. for example you may allow them to use some extra filter only once.

<jb-searchbar>
  <jb-extra-filter>
    <jb-number-input name="age" data-label="age" data-max-count="1"/>
  </jb-extra-filter>
</jb-searchbar>

placeholder

you can set placeholder of extra filter select in extra filter placeholder attribute.


<jb-extra-filter placeholder="please choose column"></jb-extra-filter>

set filter list

filter list is a list of your filter you want user choose filter from and set like this:

search on change

you can trigger search by clicking on search button, if you want to trigger it on every change set searchOnChange like this:

document.querySelector('jb-searchbar').searchOnChange = true;

css variables

| Name | Description | Default Value | |-------------------------------------|--------------------------------------------|----------------| | --jb-searchbar-filter-item-bg-color | background color of completed filter item | #408cff | | --jb-searchbar-filter-item-color | text color of completed filter item | #fff |