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

vaul-snap-points

v1.0.0

Published

Drawer component for React with dynamic snap points support - unofficial fork of vaul.

Readme

vaul-snap-points

⚠️ Unofficial Fork

This is an unofficial fork of vaul that includes PR #548 by @s-fletcher, which adds support for dynamic snap points via the <Drawer.SnapPoint /> component.

Not actively maintained - This package exists to make the snap points feature available while the original PR is pending. Use at your own risk.

What This Adds

The original vaul supports snap points with hard-coded values, but this fork adds:

  • <Drawer.SnapPoint /> component - Define snap positions dynamically based on DOM elements
  • Responsive behavior - Snap points automatically adapt to different screen sizes
  • Offset support - Fine-tune snap point positions with the offset prop
  • Callback functionality - Combine hard-coded and dynamic snap points

Installation

npm install vaul-snap-points
# or
pnpm add vaul-snap-points
# or
yarn add vaul-snap-points

Example Usage

Basic Dynamic Snap Points

import { Drawer } from 'vaul-snap-points';

function MyDrawer() {
  return (
    <Drawer.Root snapPoints={(embeddedPoints) => [...embeddedPoints, 1]}>
      <Drawer.Trigger>Open Drawer</Drawer.Trigger>
      <Drawer.Portal>
        <Drawer.Overlay />
        <Drawer.Content>
          <Drawer.SnapPoint offset={0} />
          <div>Content section 1</div>

          <Drawer.SnapPoint offset={24} />
          <div>Content section 2</div>
        </Drawer.Content>
      </Drawer.Portal>
    </Drawer.Root>
  );
}

How It Works

Instead of defining snap points with hard-coded pixel or percentage values:

// Old approach (still supported)
<Drawer.Root snapPoints={['148px', '355px', 1]}>

You can now use <Drawer.SnapPoint /> components that automatically calculate their positions based on where they appear in the DOM:

// New approach - responsive and dynamic
<Drawer.Root snapPoints={(embeddedPoints) => [...embeddedPoints, 1]}>
  <Drawer.Content>
    <Drawer.SnapPoint offset={0} />
    {/* Content that determines the snap point height */}
    <Drawer.SnapPoint offset={24} />
    {/* More content */}
  </Drawer.Content>
</Drawer.Root>

The snap points will automatically adjust based on the actual rendered height of your content.

Documentation

For full API documentation and additional features, see the original vaul documentation.

All original vaul features are supported in this fork.

Credits

License

MIT - See LICENSE.md

This project maintains the original MIT license from vaul. All credit for the original work goes to Emil Kowalski.