divsuccessbeginner

Success Alert

A green success alert with a checkmark icon, message text, and dismiss button.

Preview

Success!

Your changes have been saved successfully.

<div class="flex items-start gap-3 p-4 bg-green-50 border border-green-200 rounded-lg max-w-md">
  <svg class="w-5 h-5 text-green-600 mt-0.5 flex-shrink-0" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"></path></svg>
  <div class="flex-1">
    <p class="text-sm font-semibold text-green-800">Success!</p>
    <p class="text-sm text-green-700">Your changes have been saved successfully.</p>
  </div>
  <button class="text-green-500 hover:text-green-700">
    <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

Background

bg-green-50

#f0fdf4

Border

border-green-200

#bbf7d0

Icon

text-green-600

#16a34a

Title

text-green-800

#166534

Message

text-green-700

#15803d

Dark Mode Variant

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

dark:bg-green-900/20 dark:border-green-800 dark:text-green-400

Use Cases

Form submission confirmationPayment successSettings saved

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 auto-dismiss the alert?
Use JavaScript setTimeout to add a fade-out animation class and then remove the element after a few seconds.