Skip to content

Dark Dashboard Sidebar

Dark Bootstrap 6 dashboard sidebar with user profile, grouped icon nav, collapsible submenu and an upgrade card, turning into a Drawer on mobile.

Also known as: dark sidebar, dashboard sidebar, sidebar with user profile, sidebar navigation menu, sidebar with upgrade card

Dark Dashboard Sidebar live demo

Open in new tab

Bootstrap 6 code (HTML, CSS, JS)

A dark Bootstrap 6 admin sidebar with a user profile block, grouped icon navigation, a collapsible Products submenu and an "Upgrade to Pro" card with a storage meter. On desktop it is a fixed column next to the dashboard. Below 1024 px the same markup becomes a Bootstrap 6 Drawer that slides in from the left.

How it works

The sidebar is one <dialog class="drawer drawer-start lg:drawer dds-side">. The responsive lg:drawer class keeps it static and always visible from the lg breakpoint up, and turns it into a modal drawer below that. The hamburger button .dds-open (hidden on desktop with lg:d-none) opens it through the data API with data-bs-toggle="drawer". The drawer header with the close button is only shown on small screens, and the desktop logo .dds-brand-desk is only shown on large ones.

Inside .dds-inner you find the brand, the .dds-profile card with a Bootstrap 6 .avatar and .avatar-status.status-online, two labelled ul.nav.flex-column lists, and the .dds-upgrade card. Badges use badge theme-accent. The Products item is a Bootstrap Collapse trigger. Its chevron .dds-caret rotates through an [aria-expanded="true"] selector, because Bootstrap 6 no longer adds a .collapsed class.

script.js keeps aria-expanded on the hamburger in sync with the drawer's show.bs.drawer and hidden.bs.drawer events, which the alpha data API does not do. It also moves .active and aria-current="page" to the clicked link, copies its label into .dds-title, and closes the drawer after a choice on mobile.

Customization

  • --dds-accent and --dds-accent-2 on .dds-root: change the active link glow, the logo gradient, the storage bar and the chart highlight.
  • --dds-side, --dds-bg and --dds-panel on .dds-root: set the sidebar, page and card surfaces.
  • --dds-side-width on .dds-root: makes the desktop column wider or narrower (16.5rem by default).
  • width on .dds-progress-bar (and aria-valuenow on .dds-progress): shows a different storage level.
  • Change lg:drawer to md:drawer on .dds-side and the 1024px media queries in style.css and script.js to 768px to keep the sidebar visible on tablets.
  • Remove preventDefault() in the link click handler when the links point to real pages.

Use cases

  • Dark-mode dashboards: a user profile and grouped icon navigation sit in one side panel
  • SaaS apps: a collapsible submenu keeps related pages together
  • Freemium products: an upgrade card in the sidebar points free users to a paid plan
  • Responsive admin layouts: the sidebar becomes a drawer on mobile

Accessibility

The sidebar dialog has aria-label="Main navigation", and each list is labelled by its visible section heading. The current page uses aria-current="page". The collapse trigger has aria-expanded and aria-controls. Icons are aria-hidden, the unread dot has a text label, and the storage meter is a progressbar with values. In drawer mode, focus is trapped in the native dialog and Escape closes it. Links have a visible teal focus ring, and the caret animation stops under prefers-reduced-motion.

Bootstrap 6 notes

Bootstrap 5's offcanvas-lg is now lg:drawer on a native <dialog class="drawer">, opened with data-bs-toggle="drawer". d-lg-none became lg:d-none, bg-primary badges are badge theme-accent, and avatars are the new .avatar component. Built on Bootstrap 6.0.0-alpha.1, so alpha APIs can still change. Icons come from Bootstrap Icons, and the avatar photo is from Unsplash; replace it with your own image.

Dark Dashboard Sidebar at a glance

Framework
Bootstrap 6
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
Bootstrap 6, Bootstrap Icons
Layout
Responsive, works on mobile, dark design
Category
Sidebars
License
Free for personal and commercial use

Questions about this template

Can I use the Dark Dashboard Sidebar code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

Load Bootstrap 6 and Bootstrap Icons from a CDN (the links are under Requirements). Paste the HTML where the component should appear, add the CSS to your stylesheet and load the JavaScript before the closing </body> tag. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. The script is plain vanilla JavaScript, so it works without jQuery, React or Vue. You can still use the markup inside those frameworks.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

Add these to your page (already included in the download):

  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@6.0.0-alpha.1/dist/css/bootstrap.min.css">
  • <script type="module" src="https://cdn.jsdelivr.net/npm/bootstrap@6.0.0-alpha.1/dist/js/bootstrap.bundle.min.js"></script>
  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">

Built for Bootstrap 6.0.0-alpha.1. Bootstrap 6 ships as an ES module, so its script and this component's JavaScript load with type="module". Alpha releases can still change before the stable version.

Dark Dashboard Sidebar – free Bootstrap 6 sidebar template
Dark Dashboard Sidebar · free Bootstrap 6 sidebar template

More Sidebars

Icon Sidebar that Expands on Hover – free Pure CSS sidebar template

Icon Sidebar that Expands on Hover

Pure CSS icon rail that widens to reveal labels, section headings and a profile on hover or keyboard focus, with an active link and badge.

Collapsible Dashboard Sidebar – free Tailwind CSS sidebar template

Collapsible Dashboard Sidebar

Dark Tailwind CSS dashboard sidebar with icons, grouped sections, an unread badge and a button that collapses it to an icon rail with tooltips.

Collapsible Icon Sidebar – free Bootstrap 6 sidebar template

Collapsible Icon Sidebar

Light glass-style Bootstrap 6 sidebar that collapses to an icon rail with the Toggler component, shows tooltips for icons while collapsed and remembers its state.

Admin Sidebar with Collapsible Menu – free Bootstrap 6 sidebar template

Admin Sidebar with Collapsible Menu

Dark Bootstrap 6 admin sidebar with icons, badges and collapsible nested menu sections that turns into a Drawer on mobile, with an account menu.

Sidebar with Nested Collapsible Menu – free Bootstrap 5 sidebar template

Sidebar with Nested Collapsible Menu

Dark Bootstrap 5 sidebar with three-level collapsible menu groups, accordion behavior, active link highlight and an off-canvas panel on mobile.