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

@brennoleon/dinamic-top-bar

v1.1.0

Published

A stack-based and fully dynamic Top Bar state manager for **React 18+** and **Next.js App Router**. Built to handle complex UI flows with predictable state restoration, while staying lightweight and SSR-safe.

Readme

Dinamic Top Bar

A stack-based and fully dynamic Top Bar state manager for React 18+ and Next.js App Router. Built to handle complex UI flows with predictable state restoration, while staying lightweight and SSR-safe.


Features

  • 🚀 Stack-based state management (push / pop)
  • ⚡ Zero-config default UI with TopBarDefault
  • 🎨 Fully customizable (layout, buttons, blur, sticky, styles)
  • ⚛️ React 18+ and Next.js App Router ready
  • 🌐 SSR safe
  • 📦 Lightweight, no Redux or Zustand

Installation

npm install dinamic-top-bar

Recommended:

pnpm add dinamic-top-bar

Usage

1. Wrap your application

Wrap your root layout with TopBarProvider. You can also include the default renderer TopBarDefault.

// app/layout.tsx
import { TopBarProvider, TopBarDefault } from "dinamic-top-bar"

export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <body>
        <TopBarProvider>
          <TopBarDefault />
          {children}
        </TopBarProvider>
      </body>
    </html>
  )
}

2. Control the Top Bar from any page

Use the useTopBar hook to update the Top Bar state.

"use client"

import { useEffect } from "react"
import { useTopBar } from "dinamic-top-bar"

export default function HomePage() {
  const { set } = useTopBar()

  useEffect(() => {
    set({
      visible: true,
      style: {
        background: "rgba(0,0,0,0.8)",
        blur: 10
      },
      layout: {
        title: <span>My App</span>,
        rightButtons: [
          {
            id: "login",
            content: "Login",
            onClick: () => console.log("Login")
          }
        ]
      }
    })
  }, [])

  return <div>My Page Content</div>
}

3. Stack-based behavior (Push / Pop)

Ideal for modals, flows, or temporary views. When the component unmounts, the previous Top Bar state is automatically restored.

import { useTopBarStack } from "dinamic-top-bar"

export default function ModalPage() {
  useTopBarStack({
    style: { background: "red" },
    layout: { title: "Danger Zone" }
  })

  return <div>Modal Content</div>
}

API

TopBarStyle

| Property | Type | Description | | -----------------: | ------------- | ------------------------------- | | height | number | Height in pixels | | paddingX | number | Horizontal padding | | gap | number | Vertical gap between rows | | background | string | CSS background | | foreground | string | Text color | | border | string | CSS border | | radius | number | Border radius | | shadow | string | CSS box-shadow | | blur | number | Backdrop blur amount | | opacity | number | Opacity value | | sticky | boolean | Uses position: sticky | | zIndex | number | Z-index | | backdropSaturate | number | Backdrop saturate factor | | backdropBrightness | number | Backdrop brightness factor | | transitions | boolean | Enables transitions | | className | string | ClassName applied to <header> | | style | CSSProperties | Extra inline styles |

TopBarLayout

| Field | Type | Description | | -------------------------- | --------- | --------------------------- | | left / center / right | ReactNode | Main layout slots | | title / subtitle | ReactNode | Center title elements | | beforeTitle / afterTitle | ReactNode | Extra nodes around title | | leftButtons / rightButtons | Array | Button configs | | floating | ReactNode | Absolute positioned content | | below | ReactNode | Content below main row |

TopBarButton

| Field | Type | Description | | -------------------- | ------------- | ------------------- | | id | string | Unique button id | | onClick | () => void | Click handler | | disabled | boolean | Disabled state | | ariaLabel | string | Accessibility label | | content | ReactNode | Main content | | leftIcon / rightIcon | ReactNode | Optional icons | | style | CSSProperties | Inline style | | className | string | ClassName |


License

MIT

Feito com s2 por Brenno Leon