DEV Community

Cover image for Tailwind CSS Badge Examples

Tailwind CSS Badge Examples

Full Stack Developer | Laravel | Livewire | Vue Js Nodejs, tailwind css
Originally published at ・2 min read

In this section we will see few tailwind CSS badge examples. badge is use show status, message,notification, inbox etc .

Tailwind CSS Badge Examples

👉 View Demo

Setup Project
Using CDN

<link href="^2/dist/tailwind.min.css" rel="stylesheet">
Enter fullscreen mode Exit fullscreen mode


The Easiest way to install Tailwind CSS with Tailwind CLI

How to Install Tailwind CSS with NPM

Simple Badge

<span class="text-xs px-2 py-0.5 font-bold bg-gray-100 text-gray-600 rounded">
<span class="px-2 py-0.5 text-xs font-bold bg-red-500 text-white rounded">

<span class="px-2 py-0.5 text-xs font-bold bg-yellow-300 text-black rounded">
<span class="text-xs px-2 py-0.5 rounded font-bold bg-green-500 text-white ">

<span class="text-xs px-2 font-bold bg-blue-500 text-white rounded py-0.5">
Enter fullscreen mode Exit fullscreen mode

Alt Text

Button with Badge

<button type="button" class="px-4 py-2 mr-2 text-white bg-blue-500 rounded">Button <span
        class="px-2 py-1 text-sm text-black bg-white rounded-full">9</span></button>
Enter fullscreen mode Exit fullscreen mode

Alt Text

Icon with Badge

<span class="relative inline-block">
    <svg xmlns="" class="w-16 h-16 text-gray-200" fill="none" viewBox="0 0 24 24"
        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
            d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4" />
        class="absolute top-0 right-0 px-2 py-1 text-xs font-bold leading-none text-red-100 transform bg-red-600 rounded-full">9</span>
Enter fullscreen mode Exit fullscreen mode

Alt Text

👉 For more tailwind css

Discussion (0)