Notification Panel

Tailwind notification dropdown panel with unread indicators.

Notifications

Ava mentioned you in Q3 planning

2 min ago

Your export report.pdf is ready

1 hr ago

Weekly digest is available

Yesterday

Tailwind CSS
<div class="w-full max-w-sm mx-auto">
  <div class="flex justify-end mb-2">
    <button class="relative w-10 h-10 rounded-full bg-white border border-slate-200 flex items-center justify-center hover:border-slate-300" aria-label="Notifications">
      <svg class="w-5 h-5 text-slate-600" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M15 17h5l-1.4-1.4A2 2 0 0118 14.2V11a6 6 0 00-4-5.7V5a2 2 0 10-4 0v.3A6 6 0 006 11v3.2a2 2 0 01-.6 1.4L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"/></svg>
      <span class="absolute top-1 right-1 w-2.5 h-2.5 rounded-full bg-rose-500 ring-2 ring-white"></span>
    </button>
  </div>
  <div class="rounded-2xl bg-white border border-slate-200 shadow-xl overflow-hidden">
    <div class="flex items-center justify-between px-4 py-3 border-b border-slate-100">
      <p class="font-bold text-sm text-slate-900">Notifications</p>
      <button class="text-xs font-semibold text-indigo-600 hover:text-indigo-500">Mark all read</button>
    </div>
    <div class="flex gap-3 px-4 py-3 border-b border-slate-100 hover:bg-slate-50">
      <span class="mt-1.5 w-2 h-2 rounded-full bg-indigo-600 shrink-0"></span>
      <div><p class="text-sm text-slate-800"><span class="font-semibold">Ava</span> mentioned you in <span class="font-semibold">Q3 planning</span></p><p class="text-xs text-slate-400 mt-0.5">2 min ago</p></div>
    </div>
    <div class="flex gap-3 px-4 py-3 border-b border-slate-100 hover:bg-slate-50">
      <span class="mt-1.5 w-2 h-2 rounded-full bg-indigo-600 shrink-0"></span>
      <div><p class="text-sm text-slate-800">Your export <span class="font-semibold">report.pdf</span> is ready</p><p class="text-xs text-slate-400 mt-0.5">1 hr ago</p></div>
    </div>
    <div class="flex gap-3 px-4 py-3 hover:bg-slate-50">
      <span class="mt-1.5 w-2 h-2 rounded-full bg-transparent shrink-0"></span>
      <div><p class="text-sm text-slate-500">Weekly digest is available</p><p class="text-xs text-slate-400 mt-0.5">Yesterday</p></div>
    </div>
  </div>
</div>

Free to use in personal and commercial projects. No attribution required.

Variants

Same component, different looks. Preview each one live and copy the code you like.

Dark

For dark dashboards and admin panels.

Notifications

Ava mentioned you in Q3 planning

2 min ago

Your export report.pdf is ready

1 hr ago

Weekly digest is available

Yesterday

Tailwind CSS

Empty

Friendly empty state for when there is nothing to show.

You are all caught up

New notifications will appear here.

Tailwind CSS

Compact

Two item version with shop flavored content for ecommerce apps.

Notifications

Your order #4821 has shipped

10 min ago

Payment of $49.00 received

2 hrs ago

Tailwind CSS

About this notification panel

A tailwind notification dropdown hangs off the bell icon and lists recent activity with unread indicators, the notification center popup pattern every dashboard needs. This notification panel ui snippet shows the full anatomy: bell with badge, header with mark-all-read, and rows with unread dots. It keeps users informed without leaving the page.

The panel is a bordered card with a header row and stacked notification rows. Unread rows carry an indigo dot; read rows drop it. The bell button shows a rose badge dot when anything is unread. In production, clicking a row marks it read and decrements the badge, all with a small state update.

Cap the panel height with overflow-y-auto so fifty notifications do not take over the screen. Group by time: today, this week, older. A bell icon dropdown menu should never be the only way to reach critical alerts; pair it with email for anything urgent.

Dashboards generate events while people work: mentions, assignments, deploys, comments. Without a panel, each event is either missed or delivered as an interrupting email that yanks attention away. The notification panel batches awareness into one glanceable spot the user checks on their own terms. It respects flow: checking is pull, not push.

The bell button carries an absolutely positioned badge with the unread count, hidden entirely when the count hits zero. The panel itself is a bordered card: a header row with mark-all-read, then stacked notification rows. Unread rows show an indigo dot; read rows drop it. Clicking a row clears its dot and decrements the badge through a small state update.

Group rows by time, today, this week, older, so the list scans instead of blurring together. Add avatars to each row for social contexts where the who matters as much as the what. Cap the panel height with internal scrolling and show the latest seven to ten, with a View all link to the full page. On mobile, switch the dropdown to a full-width panel, since the desktop pattern is too narrow for phones.

Marking everything read the moment the panel opens destroys information. A visitor who just peeked to see what arrived loses track of what was actually new, and the unread state they relied on is gone. Only clear the unread markers on explicit action: a row click or the mark-all-read button. The unread dot is the user's to-do list; never throw it away on their behalf.

Where to use it

  • ✓ SaaS dashboards
  • ✓ Admin panels
  • ✓ Social apps
  • ✓ Project management tools

Customization tips

Add avatars to each row for social contexts. Swap the dot indicators for a subtle background tint on unread rows if dots feel too small.

Design notes

When to use

A notification panel hangs off the bell icon in dashboards, social apps, and admin tools, listing recent activity with unread indicators. It fits products where events happen while the user works: mentions, assignments, and system alerts. Grouping them in one dropdown keeps the main interface clean while nothing gets missed.

What to avoid

Do not let badges pile up into triple digits that never clear, because a permanent 99+ badge trains users to ignore notifications entirely. Avoid dumping every event type into one undifferentiated list, since mixing urgent alerts with trivia buries what matters. And do not close the panel when someone clicks an item they meant to open carefully.

Accessibility

Label the bell button with its count, like Notifications, 3 unread, and make mark-as-read actions keyboard reachable. Use list semantics for the items so screen readers convey the structure, not just a wall of text.

Frequently asked questions

How do I build a tailwind notification dropdown that marks items as read?

Track read state per notification in JavaScript. On row click, remove the unread dot class and update the bell badge count. Persist the state if it must survive reloads.

Where should the notification panel ui appear on mobile?

Full-width below the header or as a bottom sheet. The desktop dropdown pattern is too narrow for phones, so switch to a full-width panel under md breakpoints.

How many notifications should the panel show?

Show the latest 7 to 10 with a View all link to a full page. Cap the dropdown height and scroll internally beyond that.

How do I add an unread count badge to a notification bell?

Absolutely position a small pill with the count at the top-right of the bell icon, and hide it entirely when the count is zero. Update the number whenever items are marked as read. Cap the display at "99+" so large counts do not stretch the badge into an oval.

How do I animate a notification panel sliding in?

Transition transform and opacity only, like translate-y with a fade, since both run on the compositor without layout work. Keep the duration under 200 milliseconds so it feels instant rather than floaty. Animate the panel container, not each row, to keep the motion clean.

Should new notifications announce to screen readers?

Use role="status" with aria-live="polite" for routine notification updates so they are announced without interrupting. Reserve aria-live="assertive" for genuinely urgent alerts. Announcing every minor update becomes noise, so batch or throttle announcements when several arrive at once.