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

@molecule/app-faceted-search-react

v1.0.1

Published

Faceted search primitives: segmented control, filter pill with dropdown, faceted bar container. Composable building blocks for property / catalog / report filter bars.

Downloads

534

Readme

@molecule/app-faceted-search-react

Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit src/index.ts JSDoc, not this file.

@molecule/app-faceted-search-react — composable building blocks for pinned faceted filter bars across property / catalog / report pages.

  • <SegmentedControl> — pill toggle group (Buy / Rent / All).
  • <FilterPill> — outlined pill trigger + dropdown panel; children become the panel content.
  • <FacetedSearchBar> — fixed-position horizontal container that wraps the row of primitives.

Each filter pill owns its dropdown content so consumers can drop in range sliders, checkbox lists, selects, etc.

Quick Start

import { FacetedSearchBar, SegmentedControl, FilterPill } from '@molecule/app-faceted-search-react'

// PriceRangePanel / MoreFiltersPanel are your own panel components.
;<FacetedSearchBar topOffsetPx={64}>
  <SegmentedControl
    value={listingType}
    onChange={setListingType}
    options={[
      { value: 'buy', label: 'Buy' },
      { value: 'rent', label: 'Rent' },
    ]}
  />
  <FilterPill label="Price" active={hasPriceFilter}>
    <PriceRangePanel filters={filters} onChange={onFilterChange} />
  </FilterPill>
  <FilterPill leadingIcon="tune" label="Filters" hideChevron panelAlign="right">
    <MoreFiltersPanel filters={filters} onChange={onFilterChange} />
  </FilterPill>
</FacetedSearchBar>

Type

feature

Installation

npm install @molecule/app-faceted-search-react @molecule/app-react @molecule/app-ui @molecule/app-ui-react react
npm install -D @types/react

API

Interfaces

FacetedSearchBarProps

Props for {@link FacetedSearchBar}.

interface FacetedSearchBarProps {
  children: ReactNode
  /** Sticky top offset (px). Defaults to 64 (i.e. below a 16-unit top nav). */
  topOffsetPx?: number
  className?: string
}

FilterPillProps

Props for {@link FilterPill}.

interface FilterPillProps {
  label: ReactNode
  /** Highlight pill when a filter value is applied. */
  active?: boolean
  /** Pill body — typically the dropdown panel content. */
  children?: ReactNode
  /** Hide chevron (e.g. "More filters" pill uses a tune icon instead). */
  hideChevron?: boolean
  /** Leading icon (material-symbols name). */
  leadingIcon?: string
  /** Panel position relative to the trigger. */
  panelAlign?: 'left' | 'right'
  dataMolId?: string
}

SegmentedControlProps

Props for {@link SegmentedControl}.

interface SegmentedControlProps<T extends string> {
  options: SegmentedControlOption<T>[]
  value: T
  onChange: (next: T) => void
  className?: string
}

Functions

FacetedSearchBar(props)

Sticky filter-bar container.

function FacetedSearchBar({
  children,
  topOffsetPx = 64,
  className,
}: FacetedSearchBarProps): JSX.Element

FilterPill(props)

Pill button + dropdown panel.

function FilterPill({
  label,
  active,
  children,
  hideChevron,
  leadingIcon,
  panelAlign = 'left',
  dataMolId,
}: FilterPillProps): JSX.Element

SegmentedControl(props)

Pill segmented control.

function SegmentedControl({
  options,
  value,
  onChange,
  className,
}: SegmentedControlProps<T>): JSX.Element

Injection Notes

Requirements

Peer dependencies:

  • @molecule/app-react ^1.0.1
  • @molecule/app-ui ^1.0.1
  • @molecule/app-ui-react ^1.0.1
  • react ^18.0.0 || ^19.0.0

Runtime Dependencies

  • @molecule/app-react

  • @molecule/app-ui

  • @molecule/app-ui-react

  • react

  • The bar is position: fixed, not sticky. It overlays the page at top: topOffsetPx and reserves NO layout space — add matching top padding to the content below it.

  • Styling prereqs: these components emit Tailwind + Material-3 token class literals (bg-surface-container-high, ring-primary, text-on-primary, border-outline-variant/20, …). They only style correctly with a Tailwind-based ClassMap bond whose theme defines the M3 color tokens (the molecule scaffold default). On other ClassMap bonds the pills lose surfaces/rings but remain functional.

  • Icon font prereq: leadingIcon and the chevron render material-symbols-outlined glyph names — without the Material Symbols font loaded they appear as raw text like "expand_more".

  • The horizontal overflow uses a hide-scrollbar class that no package defines — define it in your app CSS (webkit-scrollbar none + scrollbar-width none) or scrollbars show; purely cosmetic.

  • FilterPill closes on outside mousedown; it does not trap focus. Pill labels arrive via props — pass already-translated strings.