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

flow-stack

v0.2.2

Published

A React library for stack-based navigation inside external containers.

Downloads

293

Readme

flow-stack

Stack-based navigation for React — designed to live inside a container, not own the page.

CI npm version npm downloads License GitHub release

What it is

flow-stack is a React library for push/pop navigation inside an existing UI container — a sidebar, a sheet, a modal, an expandable panel, or any fixed-size region. It manages the entry stack, animated scene transitions, and route params, while leaving layout, sizing, and the outer shell entirely up to you.

Why it exists

Most React navigation libraries assume they own the URL or the full viewport. flow-stack makes no such assumption. It is headless by default: bring your own container, mount it wherever you need it, and use as many independent stacks on one screen as you like.

Key features

  • Push / pop / replace / reset — full navigation action set with direction awareness
  • Param-driven screens — typed params per route, with optional defaults
  • Route guards — async canEnter / canLeave per route; return false (or a rejected promise) to block any navigation action
  • Animated transitions — 8 built-in presets, fully customisable via translate, opacity, scale, easing, enterCurve, exitCurve, stagger
  • Priority-aware transition resolution — stack → route → action, with timing and style merged independently so duration set at the stack level survives a string preset at the route level
  • Reduced motionreducedMotion prop on the provider; respects prefers-reduced-motion by default
  • Multiple independent stacks — mount as many NavigationStackProvider instances as you need; each is fully isolated and identified by its id
  • Controlled and uncontrolled — manage state externally or let the library own it
  • Headless controller — use createNavigationStackController outside React for testing or state-machine integration
  • Accessibility — focus management and ARIA live regions out of the box

Installation

npm install flow-stack

Requires React and react-dom ≥ 18.

Quick start

import {
  NavigationStackProvider,
  NavigationStackScreen,
  NavigationStackViewport,
  useNavigationStack,
} from 'flow-stack';

function HomeScreen() {
  const nav = useNavigationStack();
  return <button onClick={() => nav.push('details', { id: '1' })}>Open</button>;
}

function DetailsScreen({ params }) {
  const nav = useNavigationStack();
  return (
    <div>
      <p>ID: {params.id}</p>
      <button onClick={() => nav.pop()}>Back</button>
    </div>
  );
}

export function App() {
  return (
    <div style={{ width: 360, height: 600 }}>
      <NavigationStackProvider id="main" initialRoute={{ name: 'home' }}>
        <NavigationStackScreen name="home" component={HomeScreen} />
        <NavigationStackScreen name="details" component={DetailsScreen} />
        <NavigationStackViewport />
      </NavigationStackProvider>
    </div>
  );
}

Core concepts at a glance

| Concept | Description | | -------------------- | --------------------------------------------------------------------------------------------------------------------- | | Provider | Owns the stack state. One per independent navigation context. | | Screen | Declares a named route and its component. | | Viewport | Renders the visible scenes and runs transitions. Separate from the provider so you can position it freely. | | Scene | Individual scene container rendered by the viewport. Exposed for custom renderScene implementations. | | Controller | The headless state machine. The provider wraps one internally; you can also create one directly. | | useNavigationStack | Hook that gives any component inside the provider access to push, pop, replace, reset, and the current state. |

Transitions are resolved in priority order: action options → route-level transition → stack-level transition → built-in fallback. Timing fields (duration, easing, enterCurve, exitCurve, stagger) and style fields (preset, translate, opacity, scale) are merged independently so you can mix a string preset at the route level with a custom duration at the stack level.

Examples

Examples coming soon. In the meantime, see the Quick start above or browse the source on GitHub.

Docs

Deeper documentation (transitions, controlled mode, accessibility, headless controller) is in progress. Questions and requests are welcome on the GitHub issues page.

API summary

Components

| Name | Purpose | | ------------------------- | ------------------------------------------------------------------------------- | | NavigationStackProvider | Stack state, route registry, transition resolution | | NavigationStackViewport | Scene renderer and animator | | NavigationStackScreen | Declarative route definition (child of provider) | | NavigationStackScene | Scene container element; used when implementing a custom renderScene callback |

Hooks

| Name | Returns | | -------------------------- | ------------------------------------------------------------------------------------- | | useNavigationStack | Full controller — push, pop, replace, reset, setParams, state, and more | | useNavigationEntry | Active entry snapshot — entry, routeName, params, entryKey, index, isRoot | | useNavigationTransitions | Live transition state — phase, direction, anchor, isReducedMotion |

Headless

| Name | Purpose | | --------------------------------- | ------------------------------------------- | | createNavigationStackController | Framework-independent navigation controller |

Stability

Pre-release (0.x). The public API is still evolving. Breaking changes may occur before 1.0.0. Feedback on the API surface is welcome.

Contributing

Please see the CONTRIBUTING.md file for information on how to contribute to this repository.

License

This repository is licensed under the MIT License.