Breadcrumb Navigation
A modern breadcrumb navigation component with interactive elements, hover effects, and responsive design for improved user navigation experience.
Responsive Design
Yes
Dark Mode Support
No
lines
644
Browser Compatibility
No
Live Preview
Interact with the component without leaving the page.
Breadcrumb Navigation
A modern and interactive breadcrumb navigation component that shows users their current location within a websiteβs hierarchy. Features smooth animations, responsive design, and accessibility support for enhanced user experience.
Features
- Interactive Elements: Clickable breadcrumb items with hover effects
- Multiple Scenarios: Different navigation depth examples
- Copy & Share: Built-in functionality to copy or share current path
- Responsive Design: Adapts to mobile devices with vertical layout
- Accessibility: ARIA labels and keyboard navigation support
- Visual Feedback: Smooth animations and loading states
- Path Information: Real-time display of current path and depth level
Key Components
Breadcrumb Items
- Individual navigation links with icons and text
- Hover effects with subtle animations
- Current page indicator with distinct styling
- Separator elements between items
Action Buttons
- Copy path to clipboard functionality
- Share path with native sharing API
- Visual feedback for successful actions
- Keyboard shortcuts support (Ctrl+C, Ctrl+S)
Scenario Switcher
- Demo buttons to test different navigation depths
- Smooth transitions between scenarios
- Real-time breadcrumb updates
Customization Options
- Icons: Replace emoji icons with icon fonts or SVGs
- Colors: Modify color scheme to match brand
- Separators: Change separator style (arrows, slashes, dots)
- Animation Speed: Adjust transition durations
- Responsive Breakpoints: Customize mobile layout triggers
- Path Format: Modify how paths are displayed and copied
Animation Details
Item Transitions
- New items slide in from the left
- Hover effects include subtle lift and background change
- Loading state shows spinner overlay
- Smooth color transitions for interactive elements
Responsive Behavior
- Desktop: Horizontal layout with arrow separators
- Mobile: Vertical layout with indented items
- Tablet: Adaptive layout based on available space
Accessibility Features
- ARIA Labels: Proper labeling for screen readers
- Keyboard Navigation: Tab and Enter key support
- Focus Indicators: Clear focus outlines
- Semantic HTML: Uses proper
<nav>and<ol>elements - Current Page:
aria-current="page"attribute
Usage Tips
- Keep breadcrumb text concise and descriptive
- Use consistent icons throughout the navigation
- Limit breadcrumb depth to 5-6 levels maximum
- Ensure breadcrumbs reflect actual site structure
- Test on various screen sizes and devices
- Provide fallbacks for older browsers
Browser Compatibility
Works in all modern browsers. Uses CSS Grid, Flexbox, and modern JavaScript APIs. Includes fallbacks for clipboard and sharing functionality in older browsers.
HTML
72
lines
CSS
312
lines
JavaScript
260
lines
<div class="breadcrumb-demo">
<div class="demo-content">
<h2>Breadcrumb Navigation Demo</h2>
<p>Interactive breadcrumb navigation showing the current page location within the site hierarchy. Click on any breadcrumb item to navigate.</p>
<div class="demo-scenarios">
<h3>Try Different Scenarios:</h3>
<div class="scenario-buttons">
<button class="scenario-btn" data-scenario="home">Home Only</button>
<button class="scenario-btn" data-scenario="category">Category Page</button>
<button class="scenario-btn" data-scenario="product">Product Page</button>
<button class="scenario-btn" data-scenario="deep">Deep Navigation</button>
</div>
</div>
</div>
<div class="breadcrumb-container">
<nav class="breadcrumb-nav" aria-label="Breadcrumb navigation">
<ol class="breadcrumb" id="breadcrumbList">
<li class="breadcrumb-item">
<a href="#" class="breadcrumb-link" data-page="home">
<span class="breadcrumb-icon">π </span>
<span class="breadcrumb-text">Home</span>
</a>
</li>
<li class="breadcrumb-item">
<span class="breadcrumb-separator">βΊ</span>
<a href="#" class="breadcrumb-link" data-page="products">
<span class="breadcrumb-icon">π¦</span>
<span class="breadcrumb-text">Products</span>
</a>
</li>
<li class="breadcrumb-item">
<span class="breadcrumb-separator">βΊ</span>
<a href="#" class="breadcrumb-link" data-page="electronics">
<span class="breadcrumb-icon">π»</span>
<span class="breadcrumb-text">Electronics</span>
</a>
</li>
<li class="breadcrumb-item current" aria-current="page">
<span class="breadcrumb-separator">βΊ</span>
<span class="breadcrumb-current">
<span class="breadcrumb-icon">π±</span>
<span class="breadcrumb-text">Smartphones</span>
</span>
</li>
</ol>
</nav>
<div class="breadcrumb-actions">
<button class="action-btn" id="copyPath" title="Copy current path">
<span class="action-icon">π</span>
<span class="action-text">Copy Path</span>
</button>
<button class="action-btn" id="sharePath" title="Share current path">
<span class="action-icon">π</span>
<span class="action-text">Share</span>
</button>
</div>
</div>
<div class="breadcrumb-info">
<div class="info-item">
<span class="info-label">Current Path:</span>
<span class="info-value" id="currentPath">Home βΊ Products βΊ Electronics βΊ Smartphones</span>
</div>
<div class="info-item">
<span class="info-label">Depth Level:</span>
<span class="info-value" id="depthLevel">4</span>
</div>
</div>
</div>