cardnotificationbeginner

Notification Card

A notification card with icon, message, time stamp, and dismiss button.

Preview

New comment on your post

Sarah left a comment on "Getting Started with Tailwind"

2 minutes ago

<div class="bg-white rounded-xl shadow-sm border border-gray-100 p-4 max-w-md flex items-start gap-3">
  <div class="w-10 h-10 rounded-full bg-blue-100 flex items-center justify-center flex-shrink-0">
    <svg class="w-5 h-5 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"></path></svg>
  </div>
  <div class="flex-1 min-w-0">
    <p class="text-sm font-medium text-gray-800">New comment on your post</p>
    <p class="text-xs text-gray-500 mt-0.5">Sarah left a comment on "Getting Started with Tailwind"</p>
    <p class="text-xs text-gray-400 mt-1">2 minutes ago</p>
  </div>
  <button class="text-gray-400 hover:text-gray-600 flex-shrink-0">
    <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg>
  </button>
</div>

Color Breakdown

Card Background

bg-white

#ffffff

Icon Background

bg-blue-100

#dbeafe

Icon

text-blue-600

#2563eb

Title

text-gray-800

#1f2937

Description

text-gray-500

#6b7280

Time

text-gray-400

#9ca3af

Dark Mode Variant

Add these Tailwind classes for a dark mode adaptation of this recipe.

dark:bg-gray-800 dark:border-gray-700 dark:text-gray-200

Use Cases

Notification dropdownsActivity feedsInbox lists

Browser Support

All modern browsers.

Related Recipes

Build Your Own Color Recipe

Use our Tailwind CSS tools to experiment with colors, gradients, and component styles.

Explore Tools

Frequently Asked Questions

How do I mark a notification as unread?
Add a blue dot with a small div: <div class='w-2 h-2 bg-blue-500 rounded-full absolute top-2 right-2'></div> and make the card relative.