tailwind css 3 alert message example

In this section we will create alert flash message notification with tailwind css 3. We will create alert message with shadow, alert message ring style with Tailwind CSS 3.

How to install & setup Tailwind CSS v3


Example 1

Basic tailwind v3 alert message.

<div class="w-1/2">
  <div class="px-4 py-4 rounded text-slate-800 bg-slate-300" role="alert">
     A simple tailwind css alert message!
  </div>
  <div class="px-4 py-4 text-purple-800 bg-purple-300 rounded" role="alert">
      A simple tailwind css alert message!
   </div>
   <div class="px-4 py-4 text-yellow-800 bg-yellow-300 rounded" role="alert">
      A simple tailwind css alert message!
   </div>
</div>
tailwind v3 alert message ui

tailwind v3 alert message ui


Example 2

Tailwind v3 alert message with ring class.

<div class="w-1/2 space-y-2">
  <div class="px-4 py-4 rounded text-slate-800 bg-slate-300 ring-2 ring-slate-800" role="alert">
     A simple tailwind css alert message!
  </div>
  <div class="px-4 py-4 text-purple-800 bg-purple-300 rounded ring-2 ring-purple-800" role="alert">
      A simple tailwind css alert message!
   </div>
   <div class="px-4 py-4 text-yellow-800 bg-yellow-300 rounded ring-2 ring-yellow-800" role="alert">
      A simple tailwind css alert message!
   </div>
</div>
tailwind css 3 ring style alert message

tailwind css 3 ring style alert message


Example 3

Tailwind v3 alert message with shadow class.

<div class="w-1/2 space-y-2">
  <div class="px-4 py-4 rounded shadow-lg text-slate-800 bg-slate-300 shadow-slate-500/50" role="alert">
     A simple tailwind css alert message!
  </div>
  <div class="px-4 py-4 text-purple-800 bg-purple-300 rounded shadow-lg shadow-purple-500/50" role="alert">
      A simple tailwind css alert message!
   </div>
   <div class="px-4 py-4 text-yellow-800 bg-yellow-300 rounded shadow-lg shadow-yellow-500/50" role="alert">
      A simple tailwind css alert message!
   </div>
</div>
tailwind css 3 shadow alert message

tailwind css 3 shadow alert message


Example 4

Tailwind v3 alert message with dismiss alert.

<div class="w-1/2">
  <div class="flex items-center justify-between px-4 py-4 rounded text-slate-800 bg-slate-300" role="alert">
      <p>A simple tailwind css dismiss alert message with icon</p><span class="cursor-pointer"><svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
              <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
          </svg></span>
  </div>
</div>
tailwind v3 message with dismiss alert

tailwind v3 message with dismiss alert


Read Also

Tailwind CSS 3 FAQ Accordion UI Example

Tailwind CSS 3 Alert Message Example

Tailwind CSS 3 Avatars Example

Tailwind CSS 3 Badges Example

Tailwind CSS 3 Breadcrumb Example

Tailwind CSS Gradient Button Example

Tailwind CSS 3D Button Example

Tailwind CSS Loading Button Example

Tailwind CSS v3 Cards Examples

Tailwind CSS Checkbox Form Examples

Tailwind CSS Dropdowns (Menu) on Hover Example

Tailwind CSS Multiselect Dropdown Example

How to use dark mode toggle switch in Tailwind CSS 3

How to use @apply directive in Tailwind CSS

Tailwind CSS sticky header & fixed navbar example

Tailwind CSS Navbar UI Example

Tailwind CSS 3 Login Page UI Example

Tailwind CSS Login Modal Example

Tailwind CSS Search Examples

Tailwind CSS 3 Overlay Image Example

Tailwind CSS Thank You Page Example

Tailwind CSS Timeline UI Example

Tailwind CSS Responsive Footer Section Example

Tailwind CSS Background Image Header Example