Skip to content

Notification Drawer Panel

Bootstrap 5 offcanvas notification drawer with notifications grouped by day, unread filter, mark all as read and dismiss buttons.

Also known as: notifications panel, notification sidebar, activity feed drawer, slide-out notification center

Notification Drawer Panel live demo

Open in new tab

Bootstrap 5 code (HTML, CSS, JS)

A Bootstrap 5 offcanvas drawer that lists notifications grouped by day, with an unread counter on the bell, an All/Unread filter, a "Mark all as read" action and per-item dismiss buttons. Use it in dashboards, SaaS apps and admin panels where users need a quick look at recent activity without leaving the page.

How it works

The wrapper .nd-root contains a small top bar and the drawer. The bell button .nd-bell opens the panel through data-bs-toggle="offcanvas" and data-bs-target="#nd-panel"; the red badge inside it carries data-nd-count. The drawer itself is an .offcanvas.offcanvas-end.nd-panel and starts with the show class, so Bootstrap opens it on page load with its backdrop and focus trap.

Inside .offcanvas-body, every day is a section.nd-group with a sticky h3.nd-day heading ("Today", "Yesterday", "Earlier this week") and a list of .nd-item rows. Each row has a colored .nd-icon, a .nd-text button with the message and .nd-time, and a .nd-dismiss button. Unread rows get .is-unread, which adds a tinted background and an accent dot.

The script initializes every .nd-root on DOMContentLoaded and uses one delegated click listener. Clicking [data-nd-read] removes .is-unread, [data-nd-dismiss] removes the row and moves focus to a neighbor, [data-nd-filter] switches between all and unread rows, and [data-nd-markall] clears every unread state. A render() function recounts unread items, updates the bell badge and the "4 unread" label, hides empty day groups and shows [data-nd-empty] when nothing is left.

Customization

  • --nd-accent and --nd-accent-soft on .nd-root in style.css: change the violet accent used by the bell, active filter, unread dot and links.
  • --bs-offcanvas-width on .nd-panel: set a wider or narrower drawer than the default 420px.
  • offcanvas-end on the panel: use offcanvas-start to slide the drawer in from the left.
  • Remove show from .nd-panel so the drawer stays closed until the bell is clicked.
  • .nd-icon--violet, .nd-icon--green, .nd-icon--amber, .nd-icon--rose and .nd-icon--sky: pick an icon color per notification type, or add your own modifier.
  • Add or remove .is-unread on an .nd-item to set its initial state; the counters are calculated from the markup.

Use cases

  • Dashboards: a bell icon with an unread badge opens a slide-in panel of recent activity
  • SaaS apps: notifications are grouped by day with an All and Unread filter
  • Admin panels: users clear their list with mark all as read or dismiss single items
  • Account areas: colored icons tell notification types apart at a glance

Accessibility

The panel uses aria-labelledby pointing to its title, and Bootstrap handles Escape, the focus trap and returning focus to the bell. Day groups are labelled sections, filter buttons expose aria-pressed, and the icon-only dismiss buttons have aria-label. Status changes are announced through a visually hidden aria-live="polite" paragraph. All controls have a visible :focus-visible outline, and transitions are disabled under prefers-reduced-motion.

Usage notes

Requires the Bootstrap 5.3 bundle and Bootstrap Icons. Notifications are static sample markup: render the rows from your API and call your endpoint inside the click handlers to persist read and dismissed states. When you use several drawers on one page, give each panel its own id and matching data-bs-target.

Notification Drawer Panel at a glance

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

Questions about this template

Can I use the Notification Drawer Panel 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 5 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@5.3.3/dist/css/bootstrap.min.css">
  • <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/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">
Notification Drawer Panel – free Bootstrap 5 drawer template
Notification Drawer Panel · free Bootstrap 5 drawer template

More Drawers

Settings Drawer with Tabs – free Bootstrap 6 drawer template

Settings Drawer with Tabs

Dark Bootstrap 6 Drawer with tabbed settings panels (General, Alerts, Privacy), switches, a Range slider, select menus and a save bar that tracks unsaved changes.

Bottom Drawer Action Sheet – free Bootstrap 6 drawer template

Bottom Drawer Action Sheet

Bootstrap 6 bottom Drawer styled as a mobile action sheet with a share row, edit actions in a list group, pin toggle, delete action and confirmation toasts.

Filter Drawer for Product Lists – free Bootstrap 6 drawer template

Filter Drawer for Product Lists

Bootstrap 6 Drawer from the left with category checks, a Range price slider, feature toggles, rating, in-stock switch, live result count and apply/reset buttons.

Drawer Shopping Cart – free Bootstrap 6 drawer template

Drawer Shopping Cart

Bootstrap 6 Drawer shopping cart that slides in from the right with product rows, quantity steppers, a free-shipping progress bar, subtotal and checkout.

Offcanvas Shopping Cart – free Bootstrap 5 drawer template

Offcanvas Shopping Cart

Bootstrap 5 offcanvas cart drawer with quantity steppers, remove buttons, free-shipping progress, live totals and an empty state.

Slide-Over Panel – free Tailwind CSS drawer template

Slide-Over Panel

Tailwind CSS slide-over drawer from the right with header, scrollable form content, sticky footer actions, focus trap and Escape to close.