Live examples and demonstrations
The RSL Navbar is a powerful, fully accessible navigation component with multi-level dropdown support, mobile hamburger menu, keyboard navigation, and automatic ARIA management. It integrates seamlessly with RSL's density modes and works flawlessly with sticky/fixed positioning.
Get up and running in 3 minutes with our Quick Start Guide!
View Quick Start GuideA standard navigation bar with nested dropdown menus. Try using keyboard navigation (Tab + Arrow keys) and resize your browser to see the mobile menu.
Navigation Features:
• Hover over "Products", "Resources", or "Solutions" to see menus (desktop only)
• "Solutions" is a mega menu with rich content layout
• Click "Products" → "Development" to see 3rd level nested menu
• Use Tab key to navigate, arrow keys to move through menus
• Resize browser below 768px to see mobile hamburger menu
• This navbar uses data-hover-dropdowns="true" for hover on desktop, click on mobile
Create rich, multi-column dropdowns with arbitrary HTML content using data-menu-type="mega". Mega menus support RSL's grid utilities, images, buttons, and custom layouts.
Solutions
Key Features:
• Use data-menu-type="mega" on the navbar item
• Use .rsl-navbar-mega-menu instead of .rsl-navbar-dropdown
• Leverage RSL's .slot-layout for responsive columns
• Add .mega-featured for highlighted sections
• Use .mega-description for secondary text
• Fully keyboard accessible with Tab navigation
• Auto-positioning: Menus automatically adjust to stay within viewport (no horizontal scroll)
Apply the .dark-theme class for a dark color scheme. This example uses data-layout="logo-right" to position the logo on the right side with links on the left.
The dark theme automatically adjusts all colors including hover states, borders, and shadows.
Use .primary-theme for a branded navigation bar with the RSL primary color. This example uses data-layout="logo-center" to center the logo with links split evenly on both sides.
Notice the centered logo with navigation links split evenly on both sides. JavaScript automatically divides the menu items.
Programmatically control dropdowns using the RSL.Navbar API.
// Initialize all navbars
RSL.Navbar.init();
// Open a specific dropdown
const menuItem = document.querySelector('.rsl-navbar-item');
RSL.Navbar.open(menuItem);
// Close a specific dropdown
RSL.Navbar.close(menuItem);
// Close all open dropdowns
RSL.Navbar.closeAll();
| Class/Attribute | Purpose |
|---|---|
.rsl-navbar |
Main navbar container |
.rsl-navbar-brand |
Logo/brand link |
.rsl-navbar-toggle |
Mobile hamburger button |
.rsl-navbar-menu |
Menu container (ul) |
.rsl-navbar-item |
Individual menu item (li) |
.rsl-navbar-link |
Menu link (a) |
.rsl-navbar-dropdown |
Dropdown menu (nested ul) |
.dark-theme |
Dark color theme |
.primary-theme |
Primary brand color theme |
.sticky-top |
Sticky position at top |
data-hover-dropdowns="true" |
Enable hover dropdowns on desktop (default: click-only) |