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

@llui/interactions

v0.1.3

Published

Standalone DOM interaction primitives for focus, dismissal, positioning, modal isolation, and roving navigation

Readme

@llui/interactions

Standalone DOM interaction primitives for custom UI: focus containment, dismiss layers, outside-interaction detection, floating positioning, modal isolation, scroll locking, direction, and roving focus. The package contains no LLui component state machines or component markup.

pnpm add @llui/interactions @llui/dom

@llui/dom is a peer dependency, so an LLui application and all of its libraries share one runtime instance.

import { attachFloating, pushDismissable, pushFocusTrap } from '@llui/interactions'

Capping a floating surface at the space it has

attachFloating writes the space left beside the anchor, on the side the element actually lands, as two custom properties on the floating element: --llui-floating-available-height and --llui-floating-available-width (exported as FLOATING_AVAILABLE_HEIGHT / FLOATING_AVAILABLE_WIDTH). They are LLui's version of Radix's --radix-*-content-available-height. Cap a tall surface with them, and keep a viewport cap as the fallback for the frame before the first measurement:

.my-menu {
  max-height: var(--llui-floating-available-height, calc(100dvh - 2rem));
  overflow-y: auto;
}

A viewport cap alone is not enough: an anchor halfway down the page leaves far less than the viewport below it, and the surface runs off the bottom edge. Like every inline style it writes, both properties are restored to their prior values on cleanup.

Focus traps always take focus

pushFocusTrap focuses initialFocus, else the first tab-reachable descendant, else the container itself, giving it a temporary tabindex="-1" when it has none (removed on release). Focus never stays behind the trap, even in a modal with nothing focusable inside it.

Why this is a separate package

The Step-1 demand check for #49 found two in-repo consumers of the former @llui/components/utils entry point:

  • @llui/a2ui also imports the checkbox, combobox, date-picker, dialog, slider, and tabs component subpaths.
  • @llui/markdown-editor also imports the dialog component subpath.

Neither is a standalone interactions consumer. The checked external consumers were:

  • buildlab-com/dungeonlogs/packages/ui/src/atoms/modal.ts and popover.ts qualify: both implement custom overlays with the interaction primitives and no LLui component machine.
  • buildlab-com/stillkeel/packages/web/src/components/spark-tooltip.ts does not qualify: it imports attachFloating, but also builds on the LLui tooltip component machine.

The two dungeonlogs modules establish separate install-graph demand. The existing @llui/components/utils entry point remains as a compatibility re-export.