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.
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
Props
LimelightNav
Prop | Type | Default | Description |
---|---|---|---|
items | NavItem[] | defaultNavItems | Array of navigation items |
defaultActiveIndex | number | 0 | Index of the initially active item |
onTabChange | (index: number) => void | - | Callback when active tab changes |
className | string | - | Additional CSS classes for the nav container |
limelightClassName | string | - | Additional CSS classes for the limelight highlight |
iconContainerClassName | string | - | Additional CSS classes for icon containers |
iconClassName | string | - | 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:
- Dynamic positioning: Real-time calculation of active item position using DOM measurements
- Smooth transitions: CSS transforms with optimized easing for 60fps animations
- 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
NavItem Interface
Property | Type | Description |
---|---|---|
id | string | number | Unique identifier for the navigation item |
icon | React.ReactElement | Icon component to display |
label | string | Optional label for accessibility |
onClick | () => void | Optional click handler for the item |
Dock
Animated macOS-style dock component with magnification effects and smooth spring physics. A free React component for Next.js featuring TypeScript support and Tailwind CSS integration with shadcn/ui.
macOS Dock
Pixel-perfect macOS dock replica with authentic magnification physics and responsive design. A free open source React component for Next.js featuring TypeScript integration and Tailwind CSS compatibility.