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

@knitui/sheet

v0.3.1

Published

Cross-platform bottom sheet for Knit UI.

Readme

@knitui/sheet

A cross-platform (React Native + Web) bottom sheet — a panel that slides up from the bottom of the screen for mobile-friendly dialogs and action menus. Native-first, with full web parity.

Install

# Expo
npx expo install @knitui/sheet react-native-gesture-handler react-native-reanimated

# bare React Native / web
npm install @knitui/sheet react-native-gesture-handler react-native-reanimated

@knitui/sheet builds on @knitui/core + @knitui/components; install those alongside the kit as usual. react-native-gesture-handler and react-native-reanimated are required peers. Like the rest of the kit it ships TypeScript source — Expo/Metro consume it directly, and Next.js picks it up via the withKnitui wrapper from @knitui/plugins/next-plugin.

Features

  • Lightweight drag — one RNGH Gesture.Pan shared by web and native.
  • Multiple snap points + a handlesnapPoints as % of the screen; the handle cycles between them.
  • Auto-adjusts to screen size — snap offsets are derived from the measured viewport height.
  • Animations, themes, sizes — spring motion (animationConfig), full Tamagui theming, a size rounding scale, and per-slot styles.
  • Drag-to-dismiss, tap-to-dismiss, Escape-to-close, modal teleport, focus trap / return-focus, web body-scroll-lock, and native keyboard avoidance.

Anatomy

import { Sheet } from "@knitui/sheet";

function Example() {
  const [opened, setOpened] = React.useState(false);
  return (
    <>
      <Button onPress={() => setOpened(true)}>Open</Button>
      <Sheet opened={opened} onClose={() => setOpened(false)} snapPoints={[80, 40]}>
        <Sheet.Overlay />
        <Sheet.Handle />
        <Sheet.Frame>{/* …content, or <Sheet.ScrollView/> */}</Sheet.Frame>
      </Sheet>
    </>
  );
}

Sheet.Overlay, Sheet.Handle, and Sheet.Frame are optional composition markers. Plain children (with no Sheet.Frame) fold into the panel, and a default handle + scrim are rendered unless you opt out (withHandle={false} / withOverlay={false}) or override them with the markers.

Architecture

Three layers, mirroring @knitui/carousel:

  1. Engine (src/engine) — platform-free, reanimated-free, DOM-free pure functions over the panel's signed offset (px). Snap geometry, velocity-aware settle, overlay-opacity. Directly unit-tested.
  2. Motion + gesture (src/motion, src/input) — the offset SharedValue, a re-targetable spring (animateOffset), and the RNGH drag that runs settle on the UI thread.
  3. Surface + chrome (src/view, src/chrome, Sheet.tsx) — styled parts, the slot system, per-slot styles, and the open/close lifecycle that reuses the kit's Portal, focus-trap, Escape, and scroll-lock.

Web rendering

Reanimated's useAnimatedStyle does not re-run under this repo's web tooling, so on web the panel transform and the scrim opacity are painted imperatively to the DOM node whenever offset changes (view/animated.web.tsx subscribing via useSharedValueListener). Native uses the declarative useAnimatedStyle path (view/animated.tsx).

API

See src/types.ts for the full SheetProps. Key props:

| Prop | Default | Notes | | --------------------------------------------------- | --------------- | ------------------------------------------------------- | | opened / defaultOpened / onClose | — / false / — | Controlled / uncontrolled open state (kit house style). | | position / defaultPosition / onPositionChange | — / 0 / — | Current snap index. | | snapPoints | [80, 10] | % of screen, most-visible → least-visible. | | dismissOnOverlayPress | true | Tap the scrim to close. | | dismissOnSnapToBottom | false | Fling past the lowest snap to close. | | disableDrag | false | Disable all drag handling. | | modal | true | Teleport to the app root vs. render inline. | | animationConfig | — | reanimated withSpring config override. | | moveOnKeyboardChange | false | Lift above the soft keyboard (native). | | size | "lg" | Top-corner rounding scale. | | styles | — | Per-slot overrides: root / overlay / handle. |

An imperative ref exposes { open(), close(), snapTo(index) }.

Status / follow-ups

The deep scroll↔drag handoff for Sheet.ScrollView (drag the sheet when the content is scrolled to the top, scroll otherwise) is the subject of a follow-up — see docs/sheet-package-plan.md milestone 7. The current Sheet.ScrollView is a working, independently-scrolling content area.


Part of Knit UI.