Published on

How to Make A Label/Badges With Tailwind CSS?

Tags
Label/Badges

What is Tailwind CSS?

Tailwind CSS is a utility-first CSS framework that focuses on creating personalized user interfaces quickly. It can gives you all the building blocks you are able to create personalized designs without having to fight to override irritating opinionated styles. Also, Tailwind CSS is a highly configurable, low-level CSS framework.

The description of Label/Badges ui component

Responsive tag/label/badges with icons

Why use Tailwind CSS to build a Label/Badges ui component?

  • It can make the building process of Label/Badges ui component faster and more easily.
  • Enables building complex responsive layouts and components freely.
  • Minimum lines of CSS code in Label/Badges component file.

The preview of Label/Badges ui component

Free download of the Label/Badges's source code

The source code of Label/Badges ui component

<!-- MDI Icons -->
<link rel="stylesheet" href="//cdn.materialdesignicons.com/6.5.95/css/materialdesignicons.min.css">


<div class="flex items-center justify-center min-h-screen">
    <div class="flex flex-col">
        <div class="flex">
            <span class="text-center font-bold my-20 mx-auto">
                Label Badge icons required MDI (npm i @mdi/font)

                <hr class="my-4">

                <a href="https://egoistdeveloper.github.io/twcss-to-sass-playground/" target="_blank" class="text-blue-600">
                    Convetert to SASS
                </a>
            </span>
        </div>

        <div class="flex flex-col mb-14">
            <h1 class="text-left font-semibold text-2xl mb-3">
                Rounded Badges
            </h1>

            <!-- One Color Badges -->
            <div class="container">
                <!-- Black Label -->
                <a href="#" class="inline-block rounded-full text-white 
                    bg-black hover:bg-gray-500 duration-300 
                    text-xs font-bold 
                    mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                    opacity-90 hover:opacity-100">
                    Black Label
                </a>

                <!-- Red Label -->
                <a href="#" class="inline-block rounded-full text-white 
                    bg-red-400 hover:bg-red-500 duration-300 
                    text-xs font-bold 
                    mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                    opacity-90 hover:opacity-100">
                    Red Label
                </a>

                <!-- Yellow Label -->
                <a href="#" class="inline-block rounded-full text-white 
                    bg-yellow-400 hover:bg-yellow-500 duration-300 
                    text-xs font-bold 
                    mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                    opacity-90 hover:opacity-100">
                    Yellow Label
                </a>

                <!-- Green Label -->
                <a href="#" class="inline-block rounded-full text-white 
                    bg-green-400 hover:bg-green-500 duration-300 
                    text-xs font-bold 
                    mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                    opacity-90 hover:opacity-100">
                    Green Label
                </a>

                <!-- Blue Label -->
                <a href="#" class="inline-block rounded-full text-white 
                    bg-blue-400 hover:bg-blue-500 duration-300 
                    text-xs font-bold 
                    mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                    opacity-90 hover:opacity-100">
                    Blue Label
                </a>

                <!-- Purple Label -->
                <a href="#" class="inline-block rounded-full text-white 
                    bg-purple-400 hover:bg-purple-500 duration-300 
                    text-xs font-bold 
                    mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                    opacity-90 hover:opacity-100">
                    Purple Label
                </a>

                <!-- Pink Label -->
                <a href="#" class="inline-block rounded-full text-white 
                    bg-pink-400 hover:bg-pink-500 duration-300 
                    text-xs font-bold 
                    mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                    opacity-90 hover:opacity-100">
                    Pink Label
                </a>
            </div>

            <!-- Gradient Badges -->
            <div class="container">
                <!-- Black Label -->
                <a href="#" class="inline-block rounded-full text-white 
                    bg-gradient-to-br from-gray-400 to-black 
                    hover:from-gray-400 hover:to-black
                    duration-300 
                    text-xs font-bold 
                    mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                    opacity-90 hover:opacity-100">
                    Black Label
                </a>

                <!-- Red Label -->
                <a href="#" class="inline-block rounded-full text-white 
                    bg-gradient-to-br from-red-300 to-red-900 
                    hover:from-red-300 hover:to-red-900
                    duration-300 
                    text-xs font-bold 
                    mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                    opacity-90 hover:opacity-100">
                    Red Label
                </a>

                <!-- Yellow Label -->
                <a href="#" class="inline-block rounded-full text-white 
                bg-gradient-to-br from-yellow-400 to-yellow-600 
                hover:from-yellow-400 hover:to-yellow-600
                duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    Yellow Label
                </a>

                <!-- Green Label -->
                <a href="#" class="inline-block rounded-full text-white 
                bg-gradient-to-br from-green-300 to-green-600 
                hover:from-green-300 hover:to-green-600
                duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    Green Label
                </a>

                <!-- Blue Label -->
                <a href="#" class="inline-block rounded-full text-white 
                bg-gradient-to-br from-blue-300 to-blue-600 
                hover:from-blue-300 hover:to-blue-600
                duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    Blue Label
                </a>

                <!-- Purple Label -->
                <a href="#" class="inline-block rounded-full text-white 
                bg-gradient-to-br from-purple-300 to-purple-600 
                hover:from-purple-300 hover:to-purple-600
                duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    Purple Label
                </a>

                <!-- Pink Label -->
                <a href="#" class="inline-block rounded-full text-white 
                bg-gradient-to-br from-pink-300 to-pink-600 
                hover:from-pink-300 hover:to-pink-600
                duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    Pink Label
                </a>
            </div>
        </div>

        <div class="flex flex-col mb-14">
            <h1 class="text-left font-semibold text-2xl mb-3">
                Rounded Icon Badges
            </h1>

            <!-- One Color Badges -->
            <div class="container">
                <!-- Black Label -->
                <a href="#" class="inline-block rounded-full text-white 
                bg-black hover:bg-gray-500 duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    <i class="mdi mdi-memory mr-2"></i>
                    Black Label
                </a>

                <!-- Red Label -->
                <a href="#" class="inline-block rounded-full text-white 
                bg-red-400 hover:bg-red-500 duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    <i class="mdi mdi-check-all mr-2"></i>
                    Red Label
                </a>

                <!-- Yellow Label -->
                <a href="#" class="inline-block rounded-full text-white 
                bg-yellow-400 hover:bg-yellow-500 duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    <i class="mdi mdi-cloud-outline mr-2"></i>
                    Yellow Label
                </a>

                <!-- Green Label -->
                <a href="#" class="inline-block rounded-full text-white 
                bg-green-400 hover:bg-green-500 duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    <i class="mdi mdi-key mr-2"></i>
                    Green Label
                </a>

                <!-- Blue Label -->
                <a href="#" class="inline-block rounded-full text-white 
                bg-blue-400 hover:bg-blue-500 duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    <i class="mdi mdi-layers-triple-outline mr-2"></i>
                    Blue Label
                </a>

                <!-- Purple Label -->
                <a href="#" class="inline-block rounded-full text-white 
                bg-purple-400 hover:bg-purple-500 duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    <i class="mdi mdi-lightbulb-on-outline mr-2"></i>
                    Purple Label
                </a>

                <!-- Pink Label -->
                <a href="#" class="inline-block rounded-full text-white 
                bg-pink-400 hover:bg-pink-500 duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    <i class="mdi mdi-medal-outline mr-2"></i>
                    Pink Label
                </a>
            </div>

            <!-- Gradient Badges -->
            <div class="container">
                <!-- Black Label -->
                <a href="#" class="inline-block rounded-full text-white 
                bg-gradient-to-br from-gray-400 to-black 
                    hover:from-gray-400 hover:to-black
                    duration-300  
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    <i class="mdi mdi-memory mr-2"></i>
                    Black Label
                </a>

                <!-- Red Label -->
                <a href="#" class="inline-block rounded-full text-white 
                bg-gradient-to-br from-red-300 to-red-900 
                    hover:from-red-300 hover:to-red-900
                    duration-300
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    <i class="mdi mdi-check-all mr-2"></i>
                    Red Label
                </a>

                <!-- Yellow Label -->
                <a href="#" class="inline-block rounded-full text-white 
                bg-gradient-to-br from-yellow-400 to-yellow-600 
                hover:from-yellow-400 hover:to-yellow-600
                duration-300
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    <i class="mdi mdi-cloud-outline mr-2"></i>
                    Yellow Label
                </a>

                <!-- Green Label -->
                <a href="#" class="inline-block rounded-full text-white 
                bg-gradient-to-br from-green-300 to-green-600 
                hover:from-green-300 hover:to-green-600
                duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    <i class="mdi mdi-key mr-2"></i>
                    Green Label
                </a>

                <!-- Blue Label -->
                <a href="#" class="inline-block rounded-full text-white 
                bg-gradient-to-br from-blue-300 to-blue-600 
                hover:from-blue-300 hover:to-blue-600
                duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    <i class="mdi mdi-layers-triple-outline mr-2"></i>
                    Blue Label
                </a>

                <!-- Purple Label -->
                <a href="#" class="inline-block rounded-full text-white 
                bg-gradient-to-br from-purple-300 to-purple-600 
                hover:from-purple-300 hover:to-purple-600
                duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    <i class="mdi mdi-lightbulb-on-outline mr-2"></i>
                    Purple Label
                </a>

                <!-- Pink Label -->
                <a href="#" class="inline-block rounded-full text-white 
                bg-gradient-to-br from-pink-300 to-pink-600 
                hover:from-pink-300 hover:to-pink-600
                duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    <i class="mdi mdi-medal-outline mr-2"></i>
                    Pink Label
                </a>
            </div>
        </div>

        <div class="flex flex-col mb-14">
            <h1 class="text-left font-semibold text-2xl mb-3">
                Regular Badges
            </h1>

            <!-- One Color Badges -->
            <div class="container">
                <!-- Black Label -->
                <a href="#" class="inline-block rounded-sm text-white 
                bg-black hover:bg-gray-500 duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    Black Label
                </a>

                <!-- Red Label -->
                <a href="#" class="inline-block rounded-sm text-white 
                bg-red-400 hover:bg-red-500 duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    Red Label
                </a>

                <!-- Yellow Label -->
                <a href="#" class="inline-block rounded-sm text-white 
                bg-yellow-400 hover:bg-yellow-500 duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    Yellow Label
                </a>

                <!-- Green Label -->
                <a href="#" class="inline-block rounded-sm text-white 
                bg-green-400 hover:bg-green-500 duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    Green Label
                </a>

                <!-- Blue Label -->
                <a href="#" class="inline-block rounded-sm text-white 
                bg-blue-400 hover:bg-blue-500 duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    Blue Label
                </a>

                <!-- Purple Label -->
                <a href="#" class="inline-block rounded-sm text-white 
                bg-purple-400 hover:bg-purple-500 duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    Purple Label
                </a>

                <!-- Pink Label -->
                <a href="#" class="inline-block rounded-sm text-white 
                bg-pink-400 hover:bg-pink-500 duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    Pink Label
                </a>
            </div>

            <!-- Gradient Badges -->
            <div class="container">
                <!-- Black Label -->
                <a href="#" class="inline-block rounded-sm text-white 
                bg-gradient-to-br from-gray-400 to-black 
                    hover:from-gray-400 hover:to-black
                    duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    Black Label
                </a>

                <!-- Red Label -->
                <a href="#" class="inline-block rounded-sm text-white 
                bg-gradient-to-br from-red-300 to-red-900 
                    hover:from-red-300 hover:to-red-900
                    duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    Red Label
                </a>

                <!-- Yellow Label -->
                <a href="#" class="inline-block rounded-sm text-white 
                bg-gradient-to-br from-yellow-400 to-yellow-600 
                hover:from-yellow-400 hover:to-yellow-600
                duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    Yellow Label
                </a>

                <!-- Green Label -->
                <a href="#" class="inline-block rounded-sm text-white 
                bg-gradient-to-br from-green-300 to-green-600 
                hover:from-green-300 hover:to-green-600
                duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    Green Label
                </a>

                <!-- Blue Label -->
                <a href="#" class="inline-block rounded-sm text-white 
                bg-gradient-to-br from-blue-300 to-blue-600 
                hover:from-blue-300 hover:to-blue-600
                duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    Blue Label
                </a>

                <!-- Purple Label -->
                <a href="#" class="inline-block rounded-sm text-white 
                bg-gradient-to-br from-purple-300 to-purple-600 
                hover:from-purple-300 hover:to-purple-600
                duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    Purple Label
                </a>

                <!-- Pink Label -->
                <a href="#" class="inline-block rounded-sm text-white 
                bg-gradient-to-br from-pink-300 to-pink-600 
                hover:from-pink-300 hover:to-pink-600
                duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    Pink Label
                </a>
            </div>
        </div>

        <div class="flex flex-col mb-14">
            <h1 class="text-left font-semibold text-2xl mb-3">
                Regular Icon Badges
            </h1>

            <!-- One Color Badges -->
            <div class="container">
                <!-- Black Label -->
                <a href="#" class="inline-block rounded-sm text-white 
                bg-black hover:bg-gray-500 duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    <i class="mdi mdi-memory mr-2"></i>
                    Black Label
                </a>

                <!-- Red Label -->
                <a href="#" class="inline-block rounded-sm text-white 
                bg-red-400 hover:bg-red-500 duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    <i class="mdi mdi-check-all mr-2"></i>
                    Red Label
                </a>

                <!-- Yellow Label -->
                <a href="#" class="inline-block rounded-sm text-white 
                bg-yellow-400 hover:bg-yellow-500 duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    <i class="mdi mdi-cloud-outline mr-2"></i>
                    Yellow Label
                </a>

                <!-- Green Label -->
                <a href="#" class="inline-block rounded-sm text-white 
                bg-green-400 hover:bg-green-500 duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    <i class="mdi mdi-key mr-2"></i>
                    Green Label
                </a>

                <!-- Blue Label -->
                <a href="#" class="inline-block rounded-sm text-white 
                bg-blue-400 hover:bg-blue-500 duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    <i class="mdi mdi-layers-triple-outline mr-2"></i>
                    Blue Label
                </a>

                <!-- Purple Label -->
                <a href="#" class="inline-block rounded-sm text-white 
                bg-purple-400 hover:bg-purple-500 duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    <i class="mdi mdi-lightbulb-on-outline mr-2"></i>
                    Purple Label
                </a>

                <!-- Pink Label -->
                <a href="#" class="inline-block rounded-sm text-white 
                bg-pink-400 hover:bg-pink-500 duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    <i class="mdi mdi-medal-outline mr-2"></i>
                    Pink Label
                </a>
            </div>

            <!-- Gradient Badges -->
            <div class="container">
                <!-- Black Label -->
                <a href="#" class="inline-block rounded-sm text-white 
                bg-gradient-to-br from-gray-400 to-black 
                    hover:from-gray-400 hover:to-black
                    duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    <i class="mdi mdi-memory mr-2"></i>
                    Black Label
                </a>

                <!-- Red Label -->
                <a href="#" class="inline-block rounded-sm text-white 
                bg-gradient-to-br from-red-300 to-red-900 
                    hover:from-red-300 hover:to-red-900
                    duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    <i class="mdi mdi-check-all mr-2"></i>
                    Red Label
                </a>

                <!-- Yellow Label -->
                <a href="#" class="inline-block rounded-sm text-white 
                bg-gradient-to-br from-yellow-400 to-yellow-600 
                hover:from-yellow-400 hover:to-yellow-600
                duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    <i class="mdi mdi-cloud-outline mr-2"></i>
                    Yellow Label
                </a>

                <!-- Green Label -->
                <a href="#" class="inline-block rounded-sm text-white 
                bg-gradient-to-br from-green-300 to-green-600 
                hover:from-green-300 hover:to-green-600
                duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    <i class="mdi mdi-key mr-2"></i>
                    Green Label
                </a>

                <!-- Blue Label -->
                <a href="#" class="inline-block rounded-sm text-white 
                bg-gradient-to-br from-blue-300 to-blue-600 
                hover:from-blue-300 hover:to-blue-600
                duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    <i class="mdi mdi-layers-triple-outline mr-2"></i>
                    Blue Label
                </a>

                <!-- Purple Label -->
                <a href="#" class="inline-block rounded-sm text-white 
                bg-gradient-to-br from-purple-300 to-purple-600 
                hover:from-purple-300 hover:to-purple-600
                duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    <i class="mdi mdi-lightbulb-on-outline mr-2"></i>
                    Purple Label
                </a>

                <!-- Pink Label -->
                <a href="#" class="inline-block rounded-sm text-white 
                bg-gradient-to-br from-pink-300 to-pink-600 
                hover:from-pink-300 hover:to-pink-600
                duration-300 
                text-xs font-bold 
                mr-1 md:mr-2 mb-2 px-2 md:px-4 py-1 
                opacity-90 hover:opacity-100">
                    <i class="mdi mdi-medal-outline mr-2"></i>
                    Pink Label
                </a>
            </div>
        </div>
    </div>
</div>

How to build a Label/Badges with Tailwind CSS?

Install tailwind css of verion 3.0.18

Use the script html tag to import the script of Tailwind CSS of the version 3.0.18

<script src="https://cdn.tailwindcss.com"></script>

All the unility class needed to build a Label/Badges component

  • flex
  • min-h-screen
  • flex-col
  • text-center
  • my-20
  • mx-auto
  • my-4
  • text-blue-600
  • mb-14
  • text-left
  • text-2xl
  • mb-3
  • inline-block
  • text-white
  • bg-black
  • hover:bg-gray-500
  • text-xs
  • mr-1
  • md:mr-2
  • mb-2
  • px-2
  • md:px-4
  • py-1
  • bg-red-400
  • hover:bg-red-500
  • bg-yellow-400
  • hover:bg-yellow-500
  • bg-green-400
  • hover:bg-green-500
  • bg-blue-400
  • hover:bg-blue-500
  • bg-purple-400
  • hover:bg-purple-500
  • bg-pink-400
  • hover:bg-pink-500
  • bg-gradient-to-br
  • mr-2

37 steps to build a Label/Badges component with Tailwind CSS

  1. Use flex to create a block-level flex container.

  2. Set the minimum width/height of an element using the min-h-screen utilities.

  3. Use flex to create a block-level flex container.

  4. Control the text color of an element to center using the text-center utilities.

  5. Control the vertical margin of an element to 5rem using the my-20 utilities.

  6. Control the horizontal margin of an element to auto using the mx-auto utilities.

  7. Control the vertical margin of an element to 1rem using the my-4 utilities.

  8. Control the text color of an element to blue-600 using the text-blue-600 utilities.

  9. Control the margin on bottom side of an element to 3.5rem using the mb-14 utilities.

  10. Control the text color of an element to left using the text-left utilities.

  11. Control the text color of an element to 2xl using the text-2xl utilities.

  12. Control the margin on bottom side of an element to 0.75rem using the mb-3 utilities.

  13. Use inline-block utilities to wrap the element to prevent the text inside from extending beyond its parent.

  14. Control the text color of an element to white using the text-white utilities.

  15. Control the background color of an element to black using the bg-black utilities.

  16. Control the background color of an element to gray-500 using the hover:bg-gray-500 utilities on hover.

  17. Control the text color of an element to xs using the text-xs utilities.

  18. Control the margin on right side of an element to 0.25rem using the mr-1 utilities.

  19. Control the margin on right side of an element to 0.5rem at only medium screen sizes using the md:mr-2 utilities.

  20. Control the margin on bottom side of an element to 0.5rem using the mb-2 utilities.

  21. Control the horizontal padding of an element to 0.5rem using the px-2 utilities.

  22. Control the horizontal padding of an element to 1rem at only medium screen sizes using the md:px-4 utilities.

  23. Control the vertical padding of an element to 0.25rem using the py-1 utilities.

  24. Control the background color of an element to red-400 using the bg-red-400 utilities.

  25. Control the background color of an element to red-500 using the hover:bg-red-500 utilities on hover.

  26. Control the background color of an element to yellow-400 using the bg-yellow-400 utilities.

  27. Control the background color of an element to yellow-500 using the hover:bg-yellow-500 utilities on hover.

  28. Control the background color of an element to green-400 using the bg-green-400 utilities.

  29. Control the background color of an element to green-500 using the hover:bg-green-500 utilities on hover.

  30. Control the background color of an element to blue-400 using the bg-blue-400 utilities.

  31. Control the background color of an element to blue-500 using the hover:bg-blue-500 utilities on hover.

  32. Control the background color of an element to purple-400 using the bg-purple-400 utilities.

  33. Control the background color of an element to purple-500 using the hover:bg-purple-500 utilities on hover.

  34. Control the background color of an element to pink-400 using the bg-pink-400 utilities.

  35. Control the background color of an element to pink-500 using the hover:bg-pink-500 utilities on hover.

  36. Control the background color of an element to gradient-to-br using the bg-gradient-to-br utilities.

  37. Control the margin on right side of an element to 0.5rem using the mr-2 utilities.

Conclusion

The above is a step-by-step tutorial on how to use Tailwind CSS to build a Label/Badges components, learn and follow along to implement your own components.