- Published on
6 Ideas To Help You Create A Goals With Tailwind CSS Like A Pro

- What is Tailwind CSS?
- The description of Goals ui component
- Why use Tailwind CSS to make a Goals ui component?
- The preview of Goals ui component
- The source code of Goals ui component
- How to make a Goals with Tailwind CSS?
- Install tailwind css of verion 2.0.1
- All the unility class needed to make a Goals component
- 32 steps to make a Goals 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 Goals ui component
Goals widget
Why use Tailwind CSS to make a Goals ui component?
- It can make the building process of Goals ui component faster and more easily.
- Enables building complex responsive layouts and components freely.
- Minimum lines of CSS code in Goals component file.
The preview of Goals ui component
Free download of the Goals's source code
The source code of Goals ui component
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Tailwind.run Export | new / 0</title>
<link rel="stylesheet" href="tailwind.out.css">
<!-- <link rel="stylesheet" href="tailwind.purged.css"> -->
</head>
<body>
<div class="bg-indigo-700 px-4 py-5 border-b rounded-t sm:px-6">
<h3 class="text-lg leading-6 font-medium text-white">
Your Goals
</h3>
</div>
<div class="bg-white shadow overflow-hidden sm:rounded-md">
<ul class="divide-y divide-gray-200">
<li>
<a class="block hover:bg-gray-50">
<div class="px-4 py-4 sm:px-6">
<div class="flex items-center justify-between">
<p class="text-sm font-thin text-gray-700 truncate">
Increase sales by 10% year over year
</p>
<div class="ml-2 flex-shrink-0 flex">
<p class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">
On-Track
</p>
</div>
</div>
<div class="mt-2 sm:flex sm:justify-between">
<div class="sm:flex">
<p class="flex items-center text-sm font-light text-gray-500">
<time datetime="2020-01-07">January 7, 2020</time>
</p>
</div>
</div>
</div>
</a>
</li>
<li>
<a class="block hover:bg-gray-50">
<div class="px-4 py-4 sm:px-6">
<div class="flex items-center justify-between">
<p class="text-sm font-thin text-gray-700 truncate">
Increase newsletter subscribers by 500
</p>
<div class="ml-2 flex-shrink-0 flex">
<p class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-yellow-100 text-yellow-800">
At-Risk
</p>
</div>
</div>
<div class="mt-2 sm:flex sm:justify-between">
<div class="sm:flex">
<p class="flex items-center text-sm font-light text-gray-500">
<time datetime="2020-01-07">January 7, 2020</time>
</p>
</div>
</div>
</div>
</a>
</li>
<li>
<a class="block hover:bg-gray-50">
<div class="px-4 py-4 sm:px-6">
<div class="flex items-center justify-between">
<p class="text-sm font-thin text-gray-700 truncate">
Increase customer satisfaction rating by 10 points
</p>
<div class="ml-2 flex-shrink-0 flex">
<p class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">
On-Track
</p>
</div>
</div>
<div class="mt-2 sm:flex sm:justify-between">
<div class="sm:flex">
<p class="flex items-center text-sm font-light text-gray-500">
<time datetime="2020-01-07">January 7, 2020</time>
</p>
</div>
</div>
</div>
</a>
</li>
</ul>
<button type="button" class="inline-flex items-center m-4 px-4 py-1.5 border border-transparent text-xs font-medium rounded shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
View All
</button>
</div>
</body>
How to make a Goals with Tailwind CSS?
Install tailwind css of verion 2.0.1
Use the script
html tag to import the script of Tailwind CSS of the version 2.0.1
<script src="https://cdn.tailwindcss.com"></script>
All the unility class needed to make a Goals component
bg-indigo-700
px-4
py-5
border-b
sm:px-6
text-lg
text-white
bg-white
overflow-hidden
block
hover:bg-gray-50
py-4
flex
text-sm
text-gray-700
ml-2
flex-shrink-0
px-2
inline-flex
text-xs
bg-green-100
text-green-800
mt-2
sm:flex
text-gray-500
bg-yellow-100
text-yellow-800
m-4
py-1.5
border-transparent
bg-indigo-600
hover:bg-indigo-700
32 steps to make a Goals component with Tailwind CSS
Control the background color of an element to indigo-700 using the
bg-indigo-700
utilities.Control the horizontal padding of an element to 1rem using the
px-4
utilities.Control the vertical padding of an element to 1.25rem using the
py-5
utilities.Control the border color of an element to b using the
border-b
utilities.Control the horizontal padding of an element to 1.5rem at only small screen sizes using the
sm:px-6
utilities.Control the text color of an element to lg using the
text-lg
utilities.Control the text color of an element to white using the
text-white
utilities.Control the background color of an element to white using the
bg-white
utilities.Use
overflow-hidden
to clip any content within an element that overflows the bounds of that element.Use
inline
utilities to put the element on its own line and fill its parent.Control the background color of an element to gray-50 using the
hover:bg-gray-50
utilities on hover.Control the vertical padding of an element to 1rem using the
py-4
utilities.Use
flex
to create a block-level flex container.Control the text color of an element to sm using the
text-sm
utilities.Control the text color of an element to gray-700 using the
text-gray-700
utilities.Control the margin on left side of an element to 0.5rem using the
ml-2
utilities.Use
flex
to create a block-level flex container.Control the horizontal padding of an element to 0.5rem using the
px-2
utilities.Use
inline-flex
to create an inline flex container that flows with text.Control the text color of an element to xs using the
text-xs
utilities.Control the background color of an element to green-100 using the
bg-green-100
utilities.Control the text color of an element to green-800 using the
text-green-800
utilities.Control the margin on top side of an element to 0.5rem using the
mt-2
utilities.Use
flex
to create a block-level flex container at only small screen sizes.Control the text color of an element to gray-500 using the
text-gray-500
utilities.Control the background color of an element to yellow-100 using the
bg-yellow-100
utilities.Control the text color of an element to yellow-800 using the
text-yellow-800
utilities.Control the margin on all sides of an element to 1rem using the
m-4
utilities.Control the vertical padding of an element to 1.5 using the
py-1.5
utilities.Control the border color of an element to transparent using the
border-transparent
utilities.Control the background color of an element to indigo-600 using the
bg-indigo-600
utilities.Control the background color of an element to indigo-700 using the
hover:bg-indigo-700
utilities on hover.
Conclusion
The above is a step-by-step tutorial on how to use Tailwind CSS to make a Goals components, learn and follow along to implement your own components.