Join our Discord community
Dock

LimelightNav

Smart navigation component with dynamic limelight highlighting and adaptive width. A JavaScript-powered React component for Next.js featuring TypeScript integration and shadcn/ui compatibility.

Loading component...

Installation

npx shadcn@latest add https://www.shadcn.io/registry/limelight-nav.json
npx shadcn@latest add https://www.shadcn.io/registry/limelight-nav.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/limelight-nav.json
bunx shadcn@latest add https://www.shadcn.io/registry/limelight-nav.json

Features

  • Free open source React component built for Next.js applications with zero licensing costs
  • Dynamic limelight effect that smoothly tracks active navigation items using advanced JavaScript calculations
  • TypeScript-first development with comprehensive type definitions and IntelliSense support
  • Adaptive width navigation that automatically adjusts to content with responsive design patterns
  • Tailwind CSS integration for seamless styling, custom theming, and consistent design systems
  • shadcn/ui compatibility following established component patterns and design conventions
  • Built-in default icons including Home, Explore, and Notifications with SVG optimization
  • Customizable icon system supporting any React element with proper component composition
  • Full accessibility support with ARIA labels, keyboard navigation, and screen reader compatibility
  • Performance optimized with efficient DOM manipulation and minimal re-renders
  • Responsive behavior that works seamlessly across all device sizes and orientations

Usage

import { LimelightNav, type NavItem } from '@/components/ui/limelight-nav';

// Basic usage with default icons
<LimelightNav />

// Custom navigation items
const navItems: NavItem[] = [
  { id: 'home', icon: <HomeIcon />, label: 'Home' },
  { id: 'profile', icon: <UserIcon />, label: 'Profile' }
];

<LimelightNav items={navItems} onTabChange={(index) => console.log('Tab:', index)} />

Examples

Custom Navigation

Loading component...

Props

LimelightNav

PropTypeDefaultDescription
itemsNavItem[]defaultNavItemsArray of navigation items
defaultActiveIndexnumber0Index of the initially active item
onTabChange(index: number) => void-Callback when active tab changes
classNamestring-Additional CSS classes for the nav container
limelightClassNamestring-Additional CSS classes for the limelight highlight
iconContainerClassNamestring-Additional CSS classes for icon containers
iconClassNamestring-Additional CSS classes for icons

Use Cases

This free open source React component is perfect for:

  • Next.js applications - Create modern navigation with TypeScript safety and sophisticated highlighting effects
  • Dashboard interfaces - Build intuitive navigation bars with dynamic visual feedback using shadcn/ui patterns
  • Mobile-first websites - Implement adaptive navigation that responds beautifully across all screen sizes
  • SaaS platforms - Design professional navigation systems with smooth animations and JavaScript interactions
  • Portfolio sites - Showcase creative navigation with unique limelight effects using Tailwind CSS styling
  • Admin panels - Create memorable user interfaces with clear visual hierarchy and open source flexibility
  • E-commerce sites - Guide users through product categories with elegant animated navigation

Technical Details

Limelight Animation System

The component uses precise positioning calculations for smooth highlighting:

  1. Dynamic positioning: Real-time calculation of active item position using DOM measurements
  2. Smooth transitions: CSS transforms with optimized easing for 60fps animations
  3. Adaptive centering: Automatic highlight positioning that centers on active navigation items

Performance Optimizations

  • Efficient DOM updates with React refs and minimal state changes for optimal rendering
  • TypeScript-optimized component structure with proper prop validation and type safety
  • Tailwind CSS classes for consistent theming without runtime style computation
  • Smart re-rendering with useLayoutEffect for precise timing and visual stability

Accessibility

This open source component includes comprehensive accessibility features:

  • ARIA label implementation with proper navigation semantics for assistive technologies
  • Keyboard navigation support with tab order management and focus indication
  • React-compatible interaction when used in interactive Next.js applications
  • High contrast compatibility with automatic theme adaptation using Tailwind CSS
  • Screen reader friendly with descriptive labels and semantic navigation structure
PropertyTypeDescription
idstring | numberUnique identifier for the navigation item
iconReact.ReactElementIcon component to display
labelstringOptional label for accessibility
onClick() => voidOptional click handler for the item