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

modular-navbar

v1.3.6

Published

Reusable Navbar + Sidebar layout for property portals. Relies on host app's Tailwind.

Readme

property-navbar

Reusable Navbar + Sidebar React components for a Property Portal. The package relies on the host application's Tailwind and routing. Provide navigation handlers via props and provide userDetails, logo, title, etc. as props.

Install (local)

You can install this package locally or publish it to npm.

# after publishing
npm install property-navbar

Tailwind CSS Setup

This package uses Tailwind CSS for styling, but it does not bundle any CSS. Instead, it relies on the host application's Tailwind CSS setup. For the styles to be applied correctly, you must include the path to the package's components in your tailwind.config.js (or tailwind.config.ts) file.

// tailwind.config.js
module.exports = {
  content: [
    "./src/**/*.{js,ts,jsx,tsx}",
    // Add the following line:
    "./node_modules/property-navbar/dist/**/*.{js,ts,jsx,tsx}",
  ],
  theme: {
    extend: {},
  },
  plugins: [],
}

Customizing Colors

The MainNavbar component accepts a colors prop that allows you to customize the color scheme. You can import the Colors type from the package to see the available options.

Note: The colors prop only affects the MainNavbar component. The Sidebar component is styled using Tailwind CSS and can be customized by extending your Tailwind theme.

import { NavbarLayout, Colors } from 'property-navbar';

const myColors: Colors = {
  header: { background: 'linear-gradient(90deg,#4d0303,#7a0505)' },
  dropdown: {
    light: { background: '#ffffff', borderColor: '#e5e7eb', text: '#0f172a', userInfoBackground: '#f8fafc', itemHoverBackground: '#eef2f7' },
    dark: { background: '#0b1220', borderColor: '#1f2937', text: '#e6eef8', userInfoBackground: '#0b1520', itemHoverBackground: '#10202a' },
  },
  avatar: {
    light: { background: '#760f0f', text: '#ffffff' },
    dark: { background: '#850707', text: '#ffffff' }
  },
  transparent: 'transparent'
}

<NavbarLayout
  navbarProps={{
    colors: myColors,
    // ... other props
  }}
  // ... other props
/>

Sidebar Active State

To indicate the currently active page in the sidebar, you need to provide the activePath prop to the sidebarProps of the NavbarLayout component. This prop should be the href of the currently active navigation item.

Here's an example of how you can use it with next/router:

import { NavbarLayout } from 'property-navbar';
import { usePathname } from 'next/navigation';

const MyPage = () => {
  const pathname = usePathname();

  return (
    <NavbarLayout
      sidebarProps={{
        activePath: pathname,
        // ... other props
      }}
      // ... other props
    />
  );
}

Settings Sidebar

The NavbarLayout component now accepts a settingsMenuItems prop. These items will be displayed in a separate sidebar that can be opened by clicking the settings icon in the main navbar.

import { NavbarLayout } from 'property-navbar';
import { User as UserIcon } from 'lucide-react';

const settingsMenuItems = [
  { label: 'Manage Members', href: '/manageusers', icon: <UserIcon />, onClick: () => router.push('/manageusers') },
];

<NavbarLayout
  settingsMenuItems={settingsMenuItems}
  // ... other props
/>

Handling Logout

The MainNavbar component has an onLogout prop that is a function that is called when the logout button is clicked. You should provide a function that clears the user's session and redirects them to the login page.

Here's an example of how you can do this:

import { NavbarLayout } from 'property-navbar';
import { useRouter } from 'next/navigation';

const MyPage = () => {
  const router = useRouter();

  const handleLogout = () => {
    localStorage.clear();
    sessionStorage.clear();
    document.cookie = 'jwt_token=; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT';
    router.push('/login');
  };

  return (
    <NavbarLayout
      navbarProps={{
        onLogout: handleLogout,
        // ... other props
      }}
      // ... other props
    />
  );
}

Usage

See src/index.ts for exported modules. Provide your tailwind setup and icons from lucide-react in the host app.