Skip to content

Notifications Dropdown

Dark Bootstrap 6 bell Menu with unread count, unread dots, All/Unread filter, relative timestamps and a mark all as read button.

Also known as: notification dropdown, notification bell menu, notification center, unread notifications dropdown, mark all as read

Bootstrap 6 Dropdowns Responsive Dark #dark #dropdown #menu #navbar #notifications

Notifications Dropdown live demo

Open in new tab

Bootstrap 6 code (HTML, CSS, JS)

A dark Bootstrap 6 notifications dropdown that opens from a bell icon in an app header. It lists recent activity with avatars or status icons, highlights unread items with a coral dot, and offers an All/Unread filter, relative timestamps and a "Mark all as read" button. The bell's counter updates as items are read.

How it works

The bell .ntf-bell is an icon button with data-bs-toggle="menu", data-bs-placement="bottom-end" and data-bs-auto-close="outside", so the menu stays open while you read, filter or clear items. The .ntf-menu holds a header, a Bootstrap 6 radio button group (.btn-group with label.btn-check around each input), the notification items, an empty state and a "View all" link.

Each notification is an a.menu-item.ntf-item placed directly inside the menu, which keeps the Menu plugin's arrow-key navigation working. The item contains a .avatar (a photo, or an icon with avatar-subtle theme-success, theme-info or theme-warning), a .menu-item-content block and a .ntf-dot. Unread items carry .ntf-unread and a visually hidden "Unread." label for screen readers.

script.js turns each data-ntf-mins value into a real datetime and a phrase from Intl.RelativeTimeFormat ("4 minutes ago", "yesterday"), so the demo never shows stale dates. A render() function counts unread items and updates .ntf-badge, .ntf-filter-count, the bell's aria-label and the disabled state of .ntf-read-all. It also hides read items under the Unread filter and shows .ntf-empty when nothing is left. Clicking an item marks it read. For the preview, the menu opens on load and .ntf-instant skips the fade-in.

Customization

  • Remove data-ntf-open-on-load from .ntf-root so the dropdown starts closed.
  • --ntf-accent and --ntf-accent-soft on .ntf-root: recolor the badge, unread dots, unread background and links.
  • --ntf-surface, --ntf-bar and --ntf-page on .ntf-root: change the menu, header and page colors.
  • width on .ntf-menu: make the panel wider than the default 24rem.
  • Replace data-ntf-mins with timestamps from your API and pass the difference in minutes to relative().
  • Replace preventDefault() in the item click handler with navigation, and send a fetch() request to save the read state on your server.

Use cases

  • App navigation bars: a bell with an unread count shows what needs attention
  • Dashboards: an All and Unread filter helps users focus on new items
  • Social and team apps: relative timestamps show how recent each notification is
  • Inbox-style menus: a mark all as read button clears the unread dots at once

Accessibility

The bell's aria-label always states the unread count, and the Menu plugin keeps its aria-expanded current. Arrow keys move between notifications and Escape returns focus to the bell. The filter is a labelled radio group, unread state is spoken through hidden text, and "Mark all as read" is announced in a polite live region. Times are real <time> elements, decorative icons are aria-hidden, and items show a coral focus outline.

Bootstrap 6 notes

Bootstrap 5's .dropdown-menu-end and data-bs-toggle="dropdown" become data-bs-placement="bottom-end" on a data-bs-toggle="menu" button. Toggle buttons now wrap the input in label.btn-check, and colored avatars use .avatar with theme-*. Built on Bootstrap 6.0.0-alpha.1, so alpha APIs can still change. Icons come from Bootstrap Icons, and the portraits are from Unsplash; replace them with your own images.

Notifications Dropdown 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
Dropdowns
License
Free for personal and commercial use

Questions about this template

Can I use the Notifications Dropdown 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.

Notifications Dropdown – free Bootstrap 6 dropdown template
Notifications Dropdown · free Bootstrap 6 dropdown template

More Dropdowns

Hover and Focus Dropdown – free Pure CSS dropdown template

Hover and Focus Dropdown

Dark navbar with pure CSS dropdown menus that open on hover and keyboard focus, plus a small vanilla JS layer for Escape, arrow keys and touch taps.

Notifications Dropdown with User Photos – free Bootstrap 5 dropdown template

Notifications Dropdown with User Photos

Bootstrap 5 navbar bell dropdown listing notifications with user photos, activity icons, times, unread dots and a mark-all-as-read action.

User Account Menu – free Bootstrap 6 dropdown template

User Account Menu

Bootstrap 6 avatar Menu with a profile header, presence status submenu, account links, a dark mode switch and sign out.

Menu Dropdown Button Variants – free Bootstrap 6 dropdown template

Menu Dropdown Button Variants

Bootstrap 6 Menu dropdowns on buttons: split button with selectable options, drop up, drop end, drop start, headers, icons and dividers.

Nested Multi-Level Dropdown – free Pure CSS dropdown template

Nested Multi-Level Dropdown

Dark navigation bar with a three-level dropdown: flyout submenus on desktop, an inline accordion on mobile, plus hover, click and full keyboard support.

User Account Dropdown – free Bootstrap 5 dropdown template

User Account Dropdown

Bootstrap 5 avatar dropdown with profile header, plan badge, online/away/busy status picker and account menu links for app headers.