Category Β· Navigation Menus Difficulty Level Β· Beginner Published on Β· January 17, 2024

Horizontal Tab Menu

A sleek horizontal tab navigation with smooth sliding animations and modern design, perfect for content sections and dashboard interfaces.

#tabs #horizontal #navigation #sliding #modern

Responsive Design

Yes

Dark Mode Support

No

lines

587

Browser Compatibility

No

Live Preview

Interact with the component without leaving the page.

350px

Horizontal Tab Menu

A modern horizontal tab navigation system with smooth animations and interactive content panels. Perfect for organizing content sections in dashboards and web applications.

Features

  • Smooth Tab Switching: Animated transitions between content panels
  • Visual Indicator: Sliding indicator shows active tab position
  • Interactive Content: Each panel contains interactive elements
  • Keyboard Navigation: Arrow keys for tab navigation
  • Responsive Design: Adapts to different screen sizes
  • Accessibility: ARIA attributes for screen readers

Key Components

Tab Navigation

  • Icon and text labels for each tab
  • Smooth sliding indicator animation
  • Hover effects and active states
  • Horizontal scrolling on mobile

Content Panels

  • Overview: Dashboard with statistics cards
  • Analytics: Interactive chart visualization
  • Reports: Clickable report items
  • Settings: Toggle switches for preferences
  • Team: Team member cards with hover effects

Interactive Elements

  • Statistics cards with click interactions
  • Chart bars with hover animations
  • Toggle switches for settings
  • Clickable team member profiles

Customization Options

  • Colors: Modify tab colors and indicator gradient
  • Icons: Replace emoji icons with icon fonts
  • Content: Customize panel content and layout
  • Animation Speed: Adjust transition durations
  • Responsive Breakpoints: Modify mobile layout

Usage Tips

  1. Use consistent icon styles across all tabs
  2. Keep tab labels concise and descriptive
  3. Ensure content panels have similar heights
  4. Add loading states for dynamic content
  5. Consider adding tooltips for collapsed mobile view

Browser Support

Works in all modern browsers with CSS Grid, Flexbox, and CSS custom properties support.

HTML

124

lines

CSS

301

lines

JavaScript

162

lines


                <div class="tab-menu-demo">
  <div class="tab-container">
    <nav class="tab-nav">
      <div class="tab-list" role="tablist">
        <button class="tab-button active" data-tab="overview" role="tab" aria-selected="true">
          <span class="tab-icon">πŸ“Š</span>
          <span class="tab-text">Overview</span>
        </button>
        <button class="tab-button" data-tab="analytics" role="tab" aria-selected="false">
          <span class="tab-icon">πŸ“ˆ</span>
          <span class="tab-text">Analytics</span>
        </button>
        <button class="tab-button" data-tab="reports" role="tab" aria-selected="false">
          <span class="tab-icon">πŸ“‹</span>
          <span class="tab-text">Reports</span>
        </button>
        <button class="tab-button" data-tab="settings" role="tab" aria-selected="false">
          <span class="tab-icon">βš™οΈ</span>
          <span class="tab-text">Settings</span>
        </button>
        <button class="tab-button" data-tab="team" role="tab" aria-selected="false">
          <span class="tab-icon">πŸ‘₯</span>
          <span class="tab-text">Team</span>
        </button>
      </div>
      <div class="tab-indicator"></div>
    </nav>
    
    <div class="tab-content">
      <div class="tab-panel active" id="overview" role="tabpanel">
        <div class="panel-content">
          <h3>πŸ“Š Overview Dashboard</h3>
          <p>Welcome to your main dashboard. Here you can see a summary of all your important metrics and recent activities.</p>
          <div class="stats-grid">
            <div class="stat-card">
              <div class="stat-number">2,847</div>
              <div class="stat-label">Total Users</div>
            </div>
            <div class="stat-card">
              <div class="stat-number">\$12,450</div>
              <div class="stat-label">Revenue</div>
            </div>
            <div class="stat-card">
              <div class="stat-number">94.2%</div>
              <div class="stat-label">Uptime</div>
            </div>
          </div>
        </div>
      </div>
      
      <div class="tab-panel" id="analytics" role="tabpanel">
        <div class="panel-content">
          <h3>πŸ“ˆ Analytics Center</h3>
          <p>Dive deep into your data with comprehensive analytics and insights.</p>
          <div class="chart-placeholder">
            <div class="chart-bar" style="height: 60%;"></div>
            <div class="chart-bar" style="height: 80%;"></div>
            <div class="chart-bar" style="height: 45%;"></div>
            <div class="chart-bar" style="height: 90%;"></div>
            <div class="chart-bar" style="height: 70%;"></div>
          </div>
        </div>
      </div>
      
      <div class="tab-panel" id="reports" role="tabpanel">
        <div class="panel-content">
          <h3>πŸ“‹ Reports & Documents</h3>
          <p>Access and generate various reports for your business needs.</p>
          <div class="report-list">
            <div class="report-item">πŸ“„ Monthly Sales Report</div>
            <div class="report-item">πŸ“Š User Engagement Analysis</div>
            <div class="report-item">πŸ’° Financial Summary</div>
            <div class="report-item">🎯 Performance Metrics</div>
          </div>
        </div>
      </div>
      
      <div class="tab-panel" id="settings" role="tabpanel">
        <div class="panel-content">
          <h3>βš™οΈ Settings & Configuration</h3>
          <p>Customize your application settings and preferences.</p>
          <div class="settings-grid">
            <div class="setting-item">
              <span>πŸ”” Notifications</span>
              <div class="toggle-switch"></div>
            </div>
            <div class="setting-item">
              <span>πŸŒ™ Dark Mode</span>
              <div class="toggle-switch active"></div>
            </div>
            <div class="setting-item">
              <span>πŸ”’ Two-Factor Auth</span>
              <div class="toggle-switch"></div>
            </div>
          </div>
        </div>
      </div>
      
      <div class="tab-panel" id="team" role="tabpanel">
        <div class="panel-content">
          <h3>πŸ‘₯ Team Management</h3>
          <p>Manage your team members and their permissions.</p>
          <div class="team-grid">
            <div class="team-member">
              <div class="member-avatar">πŸ‘¨β€πŸ’Ό</div>
              <div class="member-name">John Smith</div>
              <div class="member-role">Admin</div>
            </div>
            <div class="team-member">
              <div class="member-avatar">πŸ‘©β€πŸ’»</div>
              <div class="member-name">Sarah Johnson</div>
              <div class="member-role">Developer</div>
            </div>
            <div class="team-member">
              <div class="member-avatar">πŸ‘¨β€πŸŽ¨</div>
              <div class="member-name">Mike Wilson</div>
              <div class="member-role">Designer</div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

              
124lines
4981characters
HTMLLanguage

Related Code Snippets

Explore template packs

Need larger building blocks? Browse responsive landing pages and component bundles.

Open HTML Template Library β†’