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

@waysnx/ui-navigation

v0.2.1

Published

Enterprise-grade navigation framework from WaysNX - menus, sidebars, breadcrumbs, and advanced navigation patterns

Readme

@waysnx/ui-navigation

Enterprise-grade navigation framework from WaysNX - menus, sidebars, breadcrumbs, and advanced navigation patterns.

Overview

@waysnx/ui-navigation is a production-ready React component library that provides a complete set of navigation components and utilities for building modern web applications.

Features

  • 10+ Navigation Components - Menu, Sidebar, Navbar, Breadcrumb, Tabs, Drawer, and more
  • Advanced Patterns - Command palette, context menus, mega menus, wizard navigation
  • Enterprise Features - Permission-based access, workspace switching, notifications
  • Full TypeScript Support - Strict mode, complete type definitions
  • Accessibility First - WCAG 2.2 AA, keyboard navigation, screen reader support
  • Theme Support - Light, dark, and custom themes with CSS variables
  • Storage Persistence - Favorites, recent items, sidebar state, theme preferences
  • Router Agnostic - Adapters for React Router, Next.js, TanStack Router
  • Performance Optimized - Memoization, lazy loading, virtualization ready
  • Tree-shakeable - Only import what you need

Installation

See INSTALLATION.md

npm install @waysnx/ui-navigation

Quick Start

Basic Menu

import React from 'react';
import { Menu, NavigationProvider } from '@waysnx/ui-navigation';

const App = () => {
  const items = [
    { id: 'home', label: 'Home', href: '/' },
    { id: 'about', label: 'About', href: '/about' },
    { id: 'contact', label: 'Contact', href: '/contact' },
  ];

  return (
    <NavigationProvider initialItems={items}>
      <Menu items={items} />
    </NavigationProvider>
  );
};

Sidebar Navigation

import { Sidebar, useSidebar } from '@waysnx/ui-navigation';

function Layout() {
  const { isOpen, toggle } = useSidebar();

  return (
    <div>
      <button onClick={toggle}>Toggle Sidebar</button>
      <Sidebar isOpen={isOpen} items={menuItems} />
    </div>
  );
}

Breadcrumb Navigation

import { Breadcrumb, useBreadcrumb } from '@waysnx/ui-navigation';

function Page() {
  const { items } = useBreadcrumb([
    { id: 'home', label: 'Home', href: '/' },
    { id: 'products', label: 'Products', href: '/products' },
    { id: 'item', label: 'Item', href: '/products/item' },
  ]);

  return <Breadcrumb items={items} />;
}

Components

Core Navigation

  • Menu - Basic menu component with nested items
  • MenuBar - Horizontal menu bar
  • Sidebar - Vertical sidebar navigation
  • Navbar - Header navigation bar
  • Header - Page header with navigation
  • Breadcrumb - Breadcrumb trail navigation

Advanced Navigation

  • ContextMenu - Right-click context menu
  • MegaMenu - Large, multi-column menu
  • TreeMenu - Tree-based hierarchical menu
  • Tabs - Tab navigation
  • Drawer - Side drawer/panel
  • Pagination - Page navigation
  • StepNavigation - Multi-step process navigation
  • Wizard - Step-by-step wizard

Enterprise Navigation

  • CommandPalette - Command palette search
  • SearchNavigation - Search-driven navigation
  • WorkspaceSwitcher - Workspace/organization switching
  • UserMenu - User account menu
  • NotificationCenter - Notification panel
  • QuickActions - Quick action toolbar
  • FavoritesMenu - Favorites/bookmarks menu
  • RecentItems - Recently accessed items

Hooks

  • useNavigation() - Access global navigation context
  • useSidebar() - Manage sidebar state
  • useMenu() - Manage menu state and operations
  • useTabs() - Manage tab navigation
  • useDrawer() - Manage drawer state
  • useBreadcrumb() - Manage breadcrumb items
  • useWorkspace() - Manage workspace switching
  • useCommandPalette() - Manage command palette

Utilities

Menu Operations

  • createMenu() - Create menu from items
  • flattenMenu() - Flatten nested menu structure
  • findMenuItem() - Find item by ID
  • filterMenu() - Filter menu by predicate
  • buildBreadcrumb() - Build breadcrumb trail
  • generateMenuTree() - Generate menu tree from flat items
  • sortMenuItems() - Sort menu items

Security & Permissions

  • canAccessItem() - Check permission for item
  • filterMenuByPermissions() - Filter by permissions
  • requirePermission() - Mark item as requiring permission
  • requireRole() - Mark item as requiring role

Storage

  • saveFavorites() - Save favorites to storage
  • getFavorites() - Get favorites from storage
  • addRecentItem() - Add to recent items
  • getRecentItems() - Get recent items
  • exportNavigationData() - Export all navigation data
  • importNavigationData() - Import navigation data

Theming

CSS Variables

All components use CSS custom properties for styling:

--nav-primary-color: rgb(59, 130, 246);
--nav-text-color: rgb(31, 41, 55);
--nav-background-color: rgb(255, 255, 255);
--nav-sidebar-width: 256px;
--nav-item-height: 40px;
/* ... and many more */

Theme Modes

import { NavigationProvider } from '@waysnx/ui-navigation';

<NavigationProvider initialItems={items}>
  <App />
</NavigationProvider>

Themes automatically respond to system preferences via prefers-color-scheme media query.

Accessibility

All components support:

  • ✅ Keyboard navigation (Tab, Arrow keys, Enter, Escape)
  • ✅ Screen reader labels (ARIA)
  • ✅ Focus management
  • ✅ High contrast mode
  • ✅ Reduced motion support

Router Integration

React Router

import { createBrowserRouter } from 'react-router-dom';
import { NavigationProvider } from '@waysnx/ui-navigation';

const router = createBrowserRouter([...]);

<NavigationProvider routerAdapter={{
  isActive: (href) => location.pathname === href,
  navigate: (href) => navigate(href),
}}>
  <RouterProvider router={router} />
</NavigationProvider>

Next.js

'use client';
import { NavigationProvider } from '@waysnx/ui-navigation';
import { useRouter, usePathname } from 'next/navigation';

export function Layout({ children }) {
  const router = useRouter();
  const pathname = usePathname();

  return (
    <NavigationProvider routerAdapter={{
      isActive: (href) => pathname === href,
      navigate: (href) => router.push(href),
    }}>
      {children}
    </NavigationProvider>
  );
}

Permission-Based Navigation

Integrate with @waysnx/ui-security:

import { Menu } from '@waysnx/ui-navigation';
import { usePermissions } from '@waysnx/ui-security';

function Navigation() {
  const { permissions, roles, features } = usePermissions();

  return (
    <Menu
      items={menuItems}
      security={{ permissions, roles, features }}
    />
  );
}

Performance

  • ✅ Memoized components prevent unnecessary re-renders
  • ✅ Lazy rendering for large menus
  • ✅ Virtualization support for scrollable lists
  • ✅ Code splitting for better bundle size
  • ✅ CSS-in-JS optimized for production

Browser Support

  • Chrome/Edge: Latest 2 versions
  • Firefox: Latest 2 versions
  • Safari: Latest 2 versions
  • Mobile: iOS 12+, Android 6+

Documentation

Examples

See /examples directory for complete working examples.

Testing

npm run test          # Run tests
npm run test:ui       # Interactive test UI
npm run test:coverage # Coverage report

Contributing

See CONTRIBUTING.md

License

Apache 2.0 - See LICENSE

Support


Made with ❤️ by WaysNX Technologies