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

@bsky.app/sift

v0.3.4

Published

A little React Native library for building autocompletes.

Readme

@bsky.app/sift

A headless autocomplete UI library for React Native (including web). Handles popover positioning, keyboard navigation, and accessibility.

Installation

pnpm add @bsky.app/sift

Peer dependencies: react, react-native, expo.

Basic example

import {useState} from 'react'
import {View, Text, TextInput} from 'react-native'
import {useSift, Sift, SiftItem} from '@bsky.app/sift'

const items = [
  {key: '1', label: 'Alice'},
  {key: '2', label: 'Bob'},
  {key: '3', label: 'Charlie'},
]

function Autocomplete() {
  const [query, setQuery] = useState('')
  const sift = useSift({offset: 4})

  const filtered = items.filter(item =>
    item.label.toLowerCase().includes(query.toLowerCase()),
  )

  return (
    <View>
      <TextInput
        {...sift.targetProps}
        value={query}
        onChangeText={setQuery}
        placeholder="Search..."
      />

      {query.length > 0 && (
        <Sift
          sift={sift}
          data={filtered}
          onSelect={item => setQuery(item.label)}
          onDismiss={() => setQuery('')}
          render={({active, props, item}) => (
            <SiftItem {...props} style={active && {backgroundColor: '#eee'}}>
              <Text>{item.label}</Text>
            </SiftItem>
          )}
        />
      )}
    </View>
  )
}

Items must have a key: string property, used internally for list rendering.

useSift options

offset

Gap in pixels between the anchor element and the popover. Defaults to 0.

const sift = useSift({offset: 8})

placement

Controls where the popover appears relative to the anchor. Accepts 'top', 'top-start', 'top-end', 'bottom', 'bottom-start', or 'bottom-end'. Defaults to 'bottom'.

const sift = useSift({placement: 'top'})

dynamicWidth

When true (default), the popover width follows the anchor. When false, the popover snaps to the input's left edge and is constrained to the input's width via maxWidth.

const sift = useSift({dynamicWidth: false})

useSift return value

| Property | Description | | ------------------ | ------------------------------------------------------------ | | targetProps | Spread onto the input (ref, ARIA attributes) | | refs.setAnchor | Ref callback for the anchor element (optional) | | refs.setPopover | Ref callback for the popover (set automatically by <Sift>) | | popoverStyles | Computed position styles applied to the popover | | updatePosition | Re-measure and update popover position | | elements.input | The input element (for keyboard handling) | | elements.popover | The popover element | | isActive() | Returns true when the popover is mounted |

If refs.setAnchor is not called, the input element is used as the anchor.

<Sift> props

render

Render function for each item. Receives active (keyboard-highlighted), props (accessibility attributes + onPress), and item.

Use <SiftItem> to wrap your item content — it's a Pressable that applies the accessibility props correctly.

<Sift
  render={({active, props, item}) => (
    <SiftItem {...props} style={active && {backgroundColor: '#eee'}}>
      <Text>{item.label}</Text>
    </SiftItem>
  )}
/>

onSelect

Called when the user selects an item, either by pressing it or by pressing Enter/Tab while it's highlighted via keyboard.

onDismiss

Called when the user presses the Escape key (web only).

inverted

Renders the list bottom-to-top and reverses keyboard navigation to match. Useful when the popover opens above the input.

style

Style applied to the popover wrapper View.

<SiftItem>

A Pressable wrapper for autocomplete items. Accepts all Pressable props plus a style that can be a function receiving {pressed, hovered} state.

<SiftItem
  {...props}
  style={s => [
    {padding: 8},
    (active || s.hovered) && {backgroundColor: '#eee'},
  ]}>
  <Text>{item.label}</Text>
</SiftItem>

Keyboard navigation (web)

| Key | Action | | ------------------- | --------------------------------------------- | | ArrowDown / ArrowUp | Move through items (reversed when inverted) | | Home / End | Jump to first / last item | | Enter / Tab | Select the active item | | Escape | Calls onDismiss |