- Published on
6 Steps To Make A Pricing With Tailwind CSS Like A Pro In Under An Hour

- What is Tailwind CSS?
- The description of Pricing ui component
- Why use Tailwind CSS to create a Pricing ui component?
- The preview of Pricing ui component
- The source code of Pricing ui component
- How to create a Pricing with Tailwind CSS?
- Install tailwind css of verion 2.2.4
- All the unility class needed to create a Pricing component
- 57 steps to create a Pricing component with Tailwind CSS
- Conclusion
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 Pricing ui component
Pricing section
Why use Tailwind CSS to create a Pricing ui component?
- It can make the building process of Pricing ui component faster and more easily.
- Enables building complex responsive layouts and components freely.
- Minimum lines of CSS code in Pricing component file.
The preview of Pricing ui component
Free download of the Pricing's source code
The source code of Pricing ui component
<!-- Pricing section -->
<section class="w-full pt-16 pb-20 bg-gray-50">
<div class="px-10 mx-auto text-center max-w-7xl">
<h2 class="text-5xl font-bold text-blue-600">
Flexible <span class="text-gray-800">Plans</span>
</h2>
<p class="mt-3 text-lg text-gray-500">Our flexible plans are designed to meet the needs of any team.</p>
<div class="grid gap-5 mt-12 lg:grid-cols-3 md:grid-cols-2">
<!-- Start First Plan -->
<div class="relative flex flex-col justify-between p-8 lg:p-6 xl:p-8 rounded-2xl">
<div class="absolute inset-0 w-full h-full transform translate-x-2 translate-y-2 bg-green-50 rounded-2xl"></div>
<div class="absolute inset-0 w-full h-full border-2 border-gray-900 rounded-2xl"></div>
<div class="relative flex pb-5 space-x-5 border-b border-gray-200 lg:space-x-3 xl:space-x-5">
<svg class="w-16 h-16 text-green-400 rounded-2xl" viewBox="0 0 150 150" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><rect x="0" y="0" width="150" height="150" rx="15"></rect></defs><g fill="none" fill-rule="evenodd"><mask fill="#fff"><use xlink:href="#plan1"></use></mask><use fill="currentColor" xlink:href="#plan1"></use><circle fill-opacity=".3" fill="#FFF" mask="url(#plan1)" cx="125" cy="25" r="50"></circle><path fill-opacity=".3" fill="#FFF" mask="url(#plan1)" d="M-33 83H67v100H-33z"></path></g></svg>
<div class="relative flex flex-col items-start">
<h3 class="text-xl font-bold">Basic Plan</h3>
<p class="tracking-tight text-gray-500">
<span class="text-sm transform inline-block -translate-y-2.5 relative">$</span>
<span class="text-3xl font-bold text-gray-800">10</span>
<span class="text-sm -translate-y-0.5 inline-block transform">/ user</span>
</p>
</div>
</div>
<ul class="relative py-12 space-y-3">
<li class="flex items-center space-x-2 text-sm font-medium text-gray-500">
<svg class="w-6 h-6 text-green-400" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><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>
<span>Custom Design & Features</span>
</li>
<li class="flex items-center space-x-2 text-sm font-medium text-gray-500">
<svg class="w-6 h-6 text-green-400" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><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>
<span>Access to 100+ Components</span>
</li>
<li class="flex items-center space-x-2 text-sm font-medium text-gray-500">
<svg class="w-6 h-6 text-green-400" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><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>
<span>Priority Email Support</span>
</li>
</ul>
<a href="#_" class="relative flex items-center justify-center w-full px-5 py-5 text-lg font-medium text-white rounded-xl group">
<span class="w-full h-full absolute inset-0 transform translate-y-1.5 translate-x-1.5 group-hover:translate-y-0 group-hover:translate-x-0 transition-all ease-out duration-200 rounded-xl bg-green-500"></span>
<span class="absolute inset-0 w-full h-full border-2 border-gray-900 rounded-xl"></span>
<span class="relative">Choose Plan</span>
<svg class="w-5 h-5 ml-2 transition-all duration-200 ease-out transform group-hover:translate-x-1" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg>
</a>
</div>
<!-- End First Plan -->
<!-- Start Middle Plan -->
<div class="relative p-8 lg:p-6 xl:p-8 rounded-2xl">
<div class="absolute inset-0 w-full h-full transform translate-x-2 translate-y-2 bg-blue-50 rounded-2xl"></div>
<div class="absolute inset-0 w-full h-full border-2 border-gray-900 rounded-2xl"></div>
<div class="relative flex pb-5 space-x-5 border-b border-gray-200 lg:space-x-3 xl:space-x-5">
<svg class="w-16 h-16 text-indigo-400 rounded-2xl" viewBox="0 0 150 150" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><rect x="0" y="0" width="150" height="150" rx="15"></rect></defs><g fill="none" fill-rule="evenodd"><mask fill="#fff"><use xlink:href="#plan1"></use></mask><use fill="currentColor" xlink:href="#plan1"></use><circle fill-opacity=".3" fill="#FFF" mask="url(#plan1)" cx="125" cy="25" r="50"></circle><path fill-opacity=".3" fill="#FFF" mask="url(#plan1)" d="M-33 83H67v100H-33z"></path></g></svg>
<div class="relative flex flex-col items-start">
<h3 class="text-xl font-bold">Professional Plan</h3>
<p class="tracking-tight text-gray-500">
<span class="text-sm transform inline-block -translate-y-2.5 relative">$</span>
<span class="text-3xl font-bold text-gray-800">25</span>
<span class="text-sm -translate-y-0.5 inline-block transform">/ user</span>
</p>
</div>
</div>
<ul class="relative py-12 space-y-3">
<li class="flex items-center space-x-2 text-sm font-medium text-gray-500">
<svg class="w-6 h-6 text-blue-400" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><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>
<span>Dedicated Design Team</span>
</li>
<li class="flex items-center space-x-2 text-sm font-medium text-gray-500">
<svg class="w-6 h-6 text-blue-400" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><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>
<span>Custom Design & Features</span>
</li>
<li class="flex items-center space-x-2 text-sm font-medium text-gray-500">
<svg class="w-6 h-6 text-blue-400" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><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>
<span>Access to 200+ Components</span>
</li>
<li class="flex items-center space-x-2 text-sm font-medium text-gray-500">
<svg class="w-6 h-6 text-blue-400" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><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>
<span>Priority Email & Chat Support</span>
</li>
</ul>
<a href="#_" class="relative flex items-center justify-center w-full px-5 py-5 text-lg font-medium text-white rounded-xl group">
<span class="w-full h-full absolute inset-0 transform translate-y-1.5 translate-x-1.5 group-hover:translate-y-0 group-hover:translate-x-0 transition-all ease-out duration-200 rounded-xl bg-blue-600"></span>
<span class="absolute inset-0 w-full h-full border-2 border-gray-900 rounded-xl"></span>
<span class="relative">Choose Plan</span>
<svg class="w-5 h-5 ml-2 transition-all duration-200 ease-out transform group-hover:translate-x-1" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg>
</a>
</div>
<!-- End Middle Plan -->
<!-- Start Third Plan -->
<div class="relative flex flex-col justify-between p-8 lg:p-6 xl:p-8 rounded-2xl md:col-span-2 lg:col-span-1">
<div class="absolute inset-0 w-full h-full transform translate-x-2 translate-y-2 bg-red-50 rounded-2xl"></div>
<div class="absolute inset-0 w-full h-full border-2 border-gray-900 rounded-2xl"></div>
<div class="relative flex pb-5 space-x-5 border-b border-gray-200 lg:space-x-3 xl:space-x-5">
<svg class="w-16 h-16 text-red-400 rounded-2xl" viewBox="0 0 150 150" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><rect x="0" y="0" width="150" height="150" rx="15"></rect></defs><g fill="none" fill-rule="evenodd"><mask fill="#fff"><use xlink:href="#plan1"></use></mask><use fill="currentColor" xlink:href="#plan1"></use><circle fill-opacity=".3" fill="#FFF" mask="url(#plan1)" cx="125" cy="25" r="50"></circle><path fill-opacity=".3" fill="#FFF" mask="url(#plan1)" d="M-33 83H67v100H-33z"></path></g></svg>
<div class="relative flex flex-col items-start">
<h3 class="text-xl font-bold">Enterprise Plan</h3>
<p class="tracking-tight text-gray-500">
<span class="text-sm transform inline-block -translate-y-2.5 relative">$</span>
<span class="text-3xl font-bold text-gray-800">35</span>
<span class="text-sm -translate-y-0.5 inline-block transform">/ user</span>
</p>
</div>
</div>
<ul class="relative py-12 space-y-3">
<li class="flex items-center space-x-2 text-sm font-medium text-gray-500">
<svg class="w-6 h-6 text-red-400" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><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>
<span>Dedicated Design & Dev Team</span>
</li>
<li class="flex items-center space-x-2 text-sm font-medium text-gray-500">
<svg class="w-6 h-6 text-red-400" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><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>
<span>Custom Design & Features</span>
</li>
<li class="flex items-center space-x-2 text-sm font-medium text-gray-500">
<svg class="w-6 h-6 text-red-400" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><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>
<span>Access to 500+ Components</span>
</li>
<li class="flex items-center space-x-2 text-sm font-medium text-gray-500">
<svg class="w-6 h-6 text-red-400" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><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>
<span>Priority Phone Support</span>
</li>
</ul>
<a href="#_" class="relative flex items-center justify-center w-full px-5 py-5 text-lg font-medium text-white rounded-xl group">
<span class="w-full h-full absolute inset-0 transform translate-y-1.5 translate-x-1.5 group-hover:translate-y-0 group-hover:translate-x-0 transition-all ease-out duration-200 rounded-xl bg-red-400"></span>
<span class="absolute inset-0 w-full h-full border-2 border-gray-900 rounded-xl"></span>
<span class="relative">Choose Plan</span>
<svg class="w-5 h-5 ml-2 transition-all duration-200 ease-out transform group-hover:translate-x-1" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg>
</a>
</div>
<!-- End Third Plan -->
</div>
</div>
</section>
How to create a Pricing with Tailwind CSS?
Install tailwind css of verion 2.2.4
Use the script
html tag to import the script of Tailwind CSS of the version 2.2.4
<script src="https://cdn.tailwindcss.com"></script>
All the unility class needed to create a Pricing component
w-full
pt-16
pb-20
bg-gray-50
px-10
mx-auto
text-center
max-w-7xl
text-5xl
text-blue-600
text-gray-800
mt-3
text-lg
text-gray-500
grid
gap-5
mt-12
lg:grid-cols-3
md:grid-cols-2
relative
flex
flex-col
p-8
lg:p-6
xl:p-8
absolute
h-full
bg-green-50
border-2
border-gray-900
pb-5
border-b
border-gray-200
w-16
h-16
text-green-400
text-xl
text-sm
inline-block
text-3xl
py-12
w-6
h-6
px-5
py-5
text-white
bg-green-500
w-5
h-5
ml-2
bg-blue-50
text-indigo-400
text-blue-400
bg-blue-600
bg-red-50
text-red-400
bg-red-400
57 steps to create a Pricing component with Tailwind CSS
Use
w-full
to set an element to a 100% based width.Control the padding on top side of an element to 4rem using the
pt-16
utilities.Control the padding on bottom side of an element to 5rem using the
pb-20
utilities.Control the background color of an element to gray-50 using the
bg-gray-50
utilities.Control the horizontal padding of an element to 2.5rem using the
px-10
utilities.Control the horizontal margin of an element to auto using the
mx-auto
utilities.Control the text color of an element to center using the
text-center
utilities.Set the maximum width/height of an element using the
max-w-7xl
utilities.Control the text color of an element to 5xl using the
text-5xl
utilities.Control the text color of an element to blue-600 using the
text-blue-600
utilities.Control the text color of an element to gray-800 using the
text-gray-800
utilities.Control the margin on top side of an element to 0.75rem using the
mt-3
utilities.Control the text color of an element to lg using the
text-lg
utilities.Control the text color of an element to gray-500 using the
text-gray-500
utilities.Use
grid
to create a grid container.To specify the width between columns, you can use the
gap-5
utilities.Control the margin on top side of an element to 3rem using the
mt-12
utilities.Use
grid
to create a grid container at only large screen sizes.Use
grid
to create a grid container at only medium screen sizes.Use
relative
to position an element according to the normal flow of the document.Use
flex
to create a block-level flex container.Use
flex
to create a block-level flex container.Control the padding on all sides of an element to 2rem using the
p-8
utilities.Control the padding on all sides of an element to 1.5rem at only large screen sizes using the
lg:p-6
utilities.Control the padding on all sides of an element to 2rem at only extremely large screen sizes using the
xl:p-8
utilities.Use
absolute
to position an element outside of the normal flow of the document, causing neighboring elements to act as if the element doesn’t exist.Use
h-full
to set an element’s height to 100% of its parent, as long as the parent has a defined height.Control the background color of an element to green-50 using the
bg-green-50
utilities.Control the border color of an element to 0.5rem using the
border-2
utilities.Control the border color of an element to gray-900 using the
border-gray-900
utilities.Control the padding on bottom side of an element to 1.25rem using the
pb-5
utilities.Control the border color of an element to b using the
border-b
utilities.Control the border color of an element to gray-200 using the
border-gray-200
utilities.Use
w-16
to set an element to a fixed width(4rem).Use
h-16
to set an element to a fixed height(4rem).Control the text color of an element to green-400 using the
text-green-400
utilities.Control the text color of an element to xl using the
text-xl
utilities.Control the text color of an element to sm using the
text-sm
utilities.Use
inline-block
utilities to wrap the element to prevent the text inside from extending beyond its parent.Control the text color of an element to 3xl using the
text-3xl
utilities.Control the vertical padding of an element to 3rem using the
py-12
utilities.Use
w-6
to set an element to a fixed width(1.5rem).Use
h-6
to set an element to a fixed height(1.5rem).Control the horizontal padding of an element to 1.25rem using the
px-5
utilities.Control the vertical padding of an element to 1.25rem using the
py-5
utilities.Control the text color of an element to white using the
text-white
utilities.Control the background color of an element to green-500 using the
bg-green-500
utilities.Use
w-5
to set an element to a fixed width(1.25rem).Use
h-5
to set an element to a fixed height(1.25rem).Control the margin on left side of an element to 0.5rem using the
ml-2
utilities.Control the background color of an element to blue-50 using the
bg-blue-50
utilities.Control the text color of an element to indigo-400 using the
text-indigo-400
utilities.Control the text color of an element to blue-400 using the
text-blue-400
utilities.Control the background color of an element to blue-600 using the
bg-blue-600
utilities.Control the background color of an element to red-50 using the
bg-red-50
utilities.Control the text color of an element to red-400 using the
text-red-400
utilities.Control the background color of an element to red-400 using the
bg-red-400
utilities.
Conclusion
The above is a step-by-step tutorial on how to use Tailwind CSS to create a Pricing components, learn and follow along to implement your own components.