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

@gridui/bottom-sheet

v1.3.1

Published

GridUI React keyboard-aware bottom sheet

Readme

@gridui/bottom-sheet

A modal bottom sheet with the existing GridUI surface, focus and motion rules. Load Theme, then BottomSheet styles (which include Overlay). The application owns labels, content, state persistence and deciding when to use a sheet.

import "@gridui/theme/styles.css";
import "@gridui/bottom-sheet/styles.css";
import {
    BottomSheet, BottomSheetTrigger, BottomSheetPanel,
    BottomSheetTitle, BottomSheetDescription, BottomSheetClose,
} from "@gridui/bottom-sheet";

<BottomSheet>
    <BottomSheetTrigger>Filters</BottomSheetTrigger>
    <BottomSheetPanel resizeLabel="Sheet height">
        <BottomSheetTitle>Filters</BottomSheetTitle>
        <BottomSheetDescription>Choose the visible results.</BottomSheetDescription>
        <BottomSheetClose>Done</BottomSheetClose>
    </BottomSheetPanel>
</BottomSheet>

Root accepts open / defaultOpen / onOpenChange. Radix Dialog owns modal focus, Escape, outside dismissal, scroll locking and return to the trigger. Title and Description provide dialog semantics; follow Radix's description contract when deliberately omitting a description. portalContainer can host the panel within an application's local theme scope.

Panel snapPoints are strictly increasing visible-viewport fractions in (0, 1], defaulting to [0.5, 0.9]. snapPoint / defaultSnapPoint / onSnapPointChange control the requested height. Values between allowed points resolve to the nearest point. Dragging the handle previews a height and commits on release; cancellation restores the committed value. Escape during a drag cancels it before dismissing the sheet; window blur, capture loss and changes to snap points or viewport height also cancel the gesture. Controlled callers can reject changes. Release projects the current position using recent vertical velocity over a short 180ms horizon. The nearest projected snap is selected; a projected position below half the smallest point requests closing unless dismissOnDrag={false}. Scrolling the content never starts a resize gesture.

The labeled handle is a vertical slider: arrows select adjacent heights and Home/End select the limits. Keyboard resizing never dismisses the sheet. Provide a visible close control. Input-method composition keys do not resize the sheet.

The panel tracks its owning window's visual viewport, including soft keyboard height and viewport panning, and includes safe-area padding. Pinch zoom retains the layout viewport contract. Coarse-pointer inputs keep a 1rem minimum font size; applications must preserve the native root font size. Reduced motion removes sheet entrance, exit and resizing transitions.

Styles

Load Theme once. Use @gridui/bottom-sheet/styled for automatic component CSS in CSS-aware bundlers, or keep the CSS-free root import and load @gridui/bottom-sheet/styles.css. Both entries expose the same root API. The standalone stylesheet includes component dependency styles; Theme/reset remain separate. See the integration guide for static HTML loading, SSR limits, and avoiding duplicate CSS.

See release history.

Component reference contains focused API pages for each public component.

Set --gridui-overlay-ease-enter and --gridui-overlay-ease-exit on the portal container or document root to tune panel and backdrop easing. They default to the Theme ease-out and ease-in curves, respectively. Reversing the open state mid-animation continues from the displayed vertical position and backdrop opacity. Drag and snap still control the sheet height.

Shared animation policy and tempo come from MotionConfig in @gridui/motion. Disabled or reduced-motion policy settles decoration without disabling interaction. See the motion guide for CSS scopes, portal behavior, and specialized timing contracts.

Resizing uses the shared interruptible spring value (stiffness 300, damping 34). Regrabbing begins at the rendered height; cancellation returns to the committed point. A stationary release loses stale velocity after 100ms. Keyboard resizing has no gesture velocity and never requests dismissal. Controlled callers may reject a snap; one release produces at most one snap-change request. The spring updates the owned height variable directly, without a React render per frame. Height animation incurs layout work because sheet content must actually resize.

Sizing and density

BottomSheet retains fractional snap points, visual-viewport bounds and independent child controls. Choose size on supplied Button/Input parts; the sheet has no whole-surface size preset.

See the shared sizing contract for native attributes, scope precedence, tokens and target behavior.