- Published on
Advanced Guide: Make A Dashboard (Not Yet!!!) With Tailwind CSS

- What is Tailwind CSS?
- The description of Dashboard (Not Yet!!!) ui component
- Why use Tailwind CSS to create a Dashboard (Not Yet!!!) ui component?
- The preview of Dashboard (Not Yet!!!) ui component
- The source code of Dashboard (Not Yet!!!) ui component
- How to create a Dashboard (Not Yet!!!) with Tailwind CSS?
- Install tailwind css of verion 2.2.4
- All the unility class needed to create a Dashboard (Not Yet!!!) component
- 60 steps to create a Dashboard (Not Yet!!!) 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 Dashboard (Not Yet!!!) ui component
Dashboard for you design
Why use Tailwind CSS to create a Dashboard (Not Yet!!!) ui component?
- It can make the building process of Dashboard (Not Yet!!!) ui component faster and more easily.
- Enables building complex responsive layouts and components freely.
- Minimum lines of CSS code in Dashboard (Not Yet!!!) component file.
The preview of Dashboard (Not Yet!!!) ui component
Free download of the Dashboard (Not Yet!!!)'s source code
The source code of Dashboard (Not Yet!!!) ui component
<div class="min-h-screen flex">
<div class="py-12 px-10 w-1/4">
<div class="flex space-2 items-center border-b-2 pb-4">
<div>
<svg xmlns="http://www.w3.org/2000/svg" class="h-14 w-14 text-indigo-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
</div>
<div class="ml-3">
<h1 class="text-3xl font-bold text-indigo-600">VENUS</h1>
<p class="text-center text-sm text-indigo-600 mt-1 font-serif">DASHBOARD</p>
</div>
</div>
<div class="flex items-center space-x-4 mt-6 p-2 bg-indigo-600 rounded-md">
<div>
<svg xmlns="http://www.w3.org/2000/svg" class="h-8 w-8 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 10a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z" />
</svg>
</div>
<div>
<p class="text-lg text-white font-semibold">Dashboard</p>
</div>
</div>
<div class="mt-8">
<ul class="space-y-10">
<li>
<a href="#" class="flex items-center text-sm font-semibold text-gray-500 hover:text-indigo-600 transition duration-200">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 mr-4 text-gray-400 hover:text-indigo-600 transition duration-200" viewBox="0 0 20 20" fill="currentColor">
<path d="M2 11a1 1 0 011-1h2a1 1 0 011 1v5a1 1 0 01-1 1H3a1 1 0 01-1-1v-5zM8 7a1 1 0 011-1h2a1 1 0 011 1v9a1 1 0 01-1 1H9a1 1 0 01-1-1V7zM14 4a1 1 0 011-1h2a1 1 0 011 1v12a1 1 0 01-1 1h-2a1 1 0 01-1-1V4z" />
</svg>
Activity</a
>
</li>
<li>
<a href="#" class="flex items-center text-sm font-semibold text-gray-500 hover:text-indigo-600 transition duration-200" hover:text-indigo-600>
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 mr-4 text-gray-400 hover:text-indigo-600 transition duration-200" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" />
</svg>
Library</a
>
</li>
<li>
<a href="#" class="flex items-center text-sm font-semibold text-gray-500 hover:text-indigo-600 transition duration-200" hover:text-indigo-600>
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 mr-4 text-gray-400 hover:text-indigo-600 transition duration-200" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M2.166 4.999A11.954 11.954 0 0010 1.944 11.954 11.954 0 0017.834 5c.11.65.166 1.32.166 2.001 0 5.225-3.34 9.67-8 11.317C5.34 16.67 2 12.225 2 7c0-.682.057-1.35.166-2.001zm11.541 3.708a1 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" />
</svg>
Security</a
>
</li>
<li>
<a href="#" class="flex items-center text-sm font-semibold text-gray-500 hover:text-indigo-600 transition duration-200" hover:text-indigo-600>
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 mr-4 text-gray-400 hover:text-indigo-600 transition duration-200" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 13.255A23.931 23.931 0 0112 15c-3.183 0-6.22-.62-9-1.745M16 6V4a2 2 0 00-2-2h-4a2 2 0 00-2 2v2m4 6h.01M5 20h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" />
</svg>
Schedules</a
>
</li>
<li>
<a href="#" class="flex items-centerx text-sm font-semibold text-gray-500 hover:text-indigo-600 transition duration-200">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 mr-4 text-gray-400 hover:text-indigo-600 transition duration-200" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
Payouts</a
>
</li>
<li>
<a href="#" class="flex items-center text-sm font-semibold text-gray-500 hover:text-indigo-600 transition duration-200" hover:text-indigo-600>
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 mr-4 text-gray-400 hover:text-indigo-600 transition duration-200" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
</svg>
Settings</a
>
</li>
</ul>
</div>
<div class="flex mt-20 space-x-4 items-center">
<div>
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 text-gray-400 hover:text-indigo-600 transition duration-200" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" />
</svg>
</div>
<a href="#" class="block font-semibold text-gray-500 hover:text-indigo-600 transition duration-200">Logout</a>
</div>
</div>
<div class="bg-indigo-50 flex-grow py-12 px-10">
<div class="flex justify-between">
<div>
<h4 class="text-sm font-bold text-indigo-600">Hi Andrei,</h4>
<h1 class="text-4xl font-bold text-indigo-900 mt-">Welcome to Venus!</h1>
</div>
<div>
<div class="flex items-center border rounded-lg bg-white w-max py-2 px-4 space-x-3">
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
</svg>
<input class="outline-none" type="text" placeholder="Search" />
</div>
</div>
</div>
<div>
<div class="flex space-x-4">
<div class="flex items-center justify-around p-6 bg-white w-64 rounded-xl space-x-2 mt-10 shadow-lg">
<div>
<span class="text-sm font-semibold text-gray-400">Spent this month</span>
<h1 class="text-2xl font-bold">$682.5</h1>
</div>
<div>
<svg xmlns="http://www.w3.org/2000/svg" class="h-8 w-8 text-indigo-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 11l7-7 7 7M5 19l7-7 7 7" />
</svg>
</div>
</div>
<div class="flex items-center justify-around p-6 bg-white w-64 rounded-xl space-x-2 mt-10 shadow-lg">
<div>
<span class="text-sm font-semibold text-gray-400">Spent this month</span>
<h1 class="text-2xl font-bold">$682.5</h1>
</div>
<div>
<svg xmlns="http://www.w3.org/2000/svg" class="h-8 w-8 text-indigo-600" viewBox="0 0 20 20" fill="currentColor">
<path d="M13 6a3 3 0 11-6 0 3 3 0 016 0zM18 8a2 2 0 11-4 0 2 2 0 014 0zM14 15a4 4 0 00-8 0v3h8v-3zM6 8a2 2 0 11-4 0 2 2 0 014 0zM16 18v-3a5.972 5.972 0 00-.75-2.906A3.005 3.005 0 0119 15v3h-3zM4.75 12.094A5.973 5.973 0 004 15v3H1v-3a3 3 0 013.75-2.906z" />
</svg>
</div>
</div>
<div class="flex items-center justify-around p-6 bg-white w-64 rounded-xl space-x-2 mt-10 shadow-lg">
<div>
<span class="text-sm font-semibold text-gray-400">Spent this month</span>
<h1 class="text-2xl font-bold">$682.5</h1>
</div>
<div>
<svg xmlns="http://www.w3.org/2000/svg" class="h-8 w-8 text-indigo-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 13v-1m4 1v-3m4 3V8M8 21l4-4 4 4M3 4h18M4 4h16v12a1 1 0 01-1 1H5a1 1 0 01-1-1V4z" />
</svg>
</div>
</div>
<div class="flex items-center justify-around p-6 bg-white w-64 rounded-xl space-x-2 mt-10 shadow-lg">
<div>
<span class="text-sm font-semibold text-gray-400">Spent this month</span>
<h1 class="text-2xl font-bold">$682.5</h1>
</div>
<div>
<svg xmlns="http://www.w3.org/2000/svg" class="h-8 w-8 text-indigo-600" viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M4 2a1 1 0 011 1v2.101a7.002 7.002 0 0111.601 2.566 1 1 0 11-1.885.666A5.002 5.002 0 005.999 7H9a1 1 0 010 2H4a1 1 0 01-1-1V3a1 1 0 011-1zm.008 9.057a1 1 0 011.276.61A5.002 5.002 0 0014.001 13H11a1 1 0 110-2h5a1 1 0 011 1v5a1 1 0 11-2 0v-2.101a7.002 7.002 0 01-11.601-2.566 1 1 0 01.61-1.276z" clip-rule="evenodd" />
</svg>
</div>
</div>
</div>
<div class="flex mt-10 justify-center">
<div>
<table class="min-w-full table-auto">
<thead class="justify-between">
<tr class="bg-indigo-600">
<th class="px-16 py-2">
<span class="text-gray-300"></span>
</th>
<th class="px-16 py-2">
<span class="text-indigo-50">Img</span>
</th>
<th class="px-16 py-2">
<span class="text-indigo-50">Name</span>
</th>
<th class="px-16 py-2">
<span class="text-indigo-50">Barcode</span>
</th>
<th class="px-16 py-2">
<span class="text-indigo-50">Price</span>
</th>
<th class="px-16 py-2">
<span class="text-indigo-50">Status</span>
</th>
</tr>
</thead>
<tbody class="bg-gray-200">
<tr class="bg-white border-4 border-gray-200 text-center">
<td class="px-16 py-2 flex flex-row items-center">
<img class="h-8 w-8 object-cover" src="https://randomuser.me/api/portraits/men/30.jpg" alt="" />
</td>
<td>
<span class="text-center ml-2 font-semibold">Dean Lynch</span>
</td>
<td class="px-16 py-2">samsung</td>
<td class="px-16 py-2">
<span>05/06/2020</span>
</td>
<td class="px-16 py-2">
<span>10:00</span>
</td>
<td class="px-16 py-2">
<span class="text-green-500">
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h5" viewBox="0 0 24 24" stroke-width="1.5" stroke="#2c3e50" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" />
<path d="M5 12l5 5l10 -10" />
</svg>
</span>
</td>
</tr>
<tr class="bg-white border-4 border-gray-200 text-center">
<td class="px-16 py-2 flex flex-row items-center">
<img class="h-8 w-8 object-cover" src="https://randomuser.me/api/portraits/men/76.jpg" alt="" />
</td>
<td>
<span class="text-center ml-2 font-semibold">Ralph Barnes</span>
</td>
<td class="px-16 py-2">Iphone 13</td>
<td class="px-16 py-2">
<span>05/06/2020</span>
</td>
<td class="px-16 py-2">
<span>12:15</span>
</td>
<td class="px-16 py-2">
<span class="text-yellow-500">
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5" viewBox="0 0 24 24" stroke-width="1.5" stroke="#2c3e50" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" />
<circle cx="12" cy="12" r="9" />
<polyline points="12 7 12 12 15 15" />
</svg>
</span>
</td>
</tr>
<tr class="bg-white border-4 border-gray-200 text-center">
<td class="px-16 py-2 flex flex-row items-center">
<img class="h-8 w-8 object-cover" src="https://randomuser.me/api/portraits/men/38.jpg" alt="" />
</td>
<td>
<span class="text-center ml-2 font-semibold">Brett Castillo</span>
</td>
<td class="px-16 py-2">Oppo mini</td>
<td class="px-16 py-2">
<span>05/06/2020</span>
</td>
<td class="px-16 py-2">
<span>08:35</span>
</td>
<td class="px-16 py-2">
<span class="text-yellow-500">
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5" viewBox="0 0 24 24" stroke-width="1.5" stroke="#2c3e50" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" />
<line x1="18" y1="6" x2="6" y2="18" />
<line x1="6" y1="6" x2="18" y2="18" />
</svg>
</span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div></div>
<div></div>
</div>
<div></div>
<div></div>
</div>
</div>
How to create a Dashboard (Not Yet!!!) 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 Dashboard (Not Yet!!!) component
min-h-screen
flex
py-12
px-10
w-1/4
border-b-2
pb-4
h-14
w-14
text-indigo-600
ml-3
text-3xl
text-center
text-sm
mt-1
mt-6
p-2
bg-indigo-600
h-8
w-8
text-white
text-lg
mt-8
text-gray-500
hover:text-indigo-600
h-6
w-6
mr-4
text-gray-400
mt-20
block
bg-indigo-50
flex-grow
text-4xl
text-indigo-900
mt-
bg-white
w-max
py-2
px-4
h-4
w-4
p-6
w-64
mt-10
text-2xl
min-w-full
table-auto
px-16
text-gray-300
text-indigo-50
bg-gray-200
border-4
border-gray-200
flex-row
ml-2
text-green-500
w-5
text-yellow-500
h-5
60 steps to create a Dashboard (Not Yet!!!) component with Tailwind CSS
Set the minimum width/height of an element using the
min-h-screen
utilities.Use
flex
to create a block-level flex container.Control the vertical padding of an element to 3rem using the
py-12
utilities.Control the horizontal padding of an element to 2.5rem using the
px-10
utilities.Use
w-1/4
to set an element to a fixed width(1/4).Control the border color of an element to b-2 using the
border-b-2
utilities.Control the padding on bottom side of an element to 1rem using the
pb-4
utilities.Use
h-14
to set an element to a fixed height(3.5rem).Use
w-14
to set an element to a fixed width(3.5rem).Control the text color of an element to indigo-600 using the
text-indigo-600
utilities.Control the margin on left side of an element to 0.75rem using the
ml-3
utilities.Control the text color of an element to 3xl using the
text-3xl
utilities.Control the text color of an element to center using the
text-center
utilities.Control the text color of an element to sm using the
text-sm
utilities.Control the margin on top side of an element to 0.25rem using the
mt-1
utilities.Control the margin on top side of an element to 1.5rem using the
mt-6
utilities.Control the padding on all sides of an element to 0.5rem using the
p-2
utilities.Control the background color of an element to indigo-600 using the
bg-indigo-600
utilities.Use
h-8
to set an element to a fixed height(2rem).Use
w-8
to set an element to a fixed width(2rem).Control the text color of an element to white using the
text-white
utilities.Control the text color of an element to lg using the
text-lg
utilities.Control the margin on top side of an element to 2rem using the
mt-8
utilities.Control the text color of an element to gray-500 using the
text-gray-500
utilities.Control the text color of an element to indigo-600 on hover using the
hover:text-indigo-600
utilities.Use
h-6
to set an element to a fixed height(1.5rem).Use
w-6
to set an element to a fixed width(1.5rem).Control the margin on right side of an element to 1rem using the
mr-4
utilities.Control the text color of an element to gray-400 using the
text-gray-400
utilities.Control the margin on top side of an element to 5rem using the
mt-20
utilities.Use
inline
utilities to put the element on its own line and fill its parent.Control the background color of an element to indigo-50 using the
bg-indigo-50
utilities.Use
flex
to create a block-level flex container.Control the text color of an element to 4xl using the
text-4xl
utilities.Control the text color of an element to indigo-900 using the
text-indigo-900
utilities.Control the margin on top side of an element to using the
mt-
utilities.Control the background color of an element to white using the
bg-white
utilities.Use
w-max
to set an element to a fixed width(max).Control the vertical padding of an element to 0.5rem using the
py-2
utilities.Control the horizontal padding of an element to 1rem using the
px-4
utilities.Use
h-4
to set an element to a fixed height(1rem).Use
w-4
to set an element to a fixed width(1rem).Control the padding on all sides of an element to 1.5rem using the
p-6
utilities.Use
w-64
to set an element to a fixed width(16rem).Control the margin on top side of an element to 2.5rem using the
mt-10
utilities.Control the text color of an element to 2xl using the
text-2xl
utilities.Set the minimum width/height of an element using the
min-w-full
utilities.Use the
table
utilities to create elements that behave like their respective table elements.Control the horizontal padding of an element to 4rem using the
px-16
utilities.Control the text color of an element to gray-300 using the
text-gray-300
utilities.Control the text color of an element to indigo-50 using the
text-indigo-50
utilities.Control the background color of an element to gray-200 using the
bg-gray-200
utilities.Control the border color of an element to 1rem using the
border-4
utilities.Control the border color of an element to gray-200 using the
border-gray-200
utilities.Use
flex
to create a block-level flex container.Control the margin on left side of an element to 0.5rem using the
ml-2
utilities.Control the text color of an element to green-500 using the
text-green-500
utilities.Use
w-5
to set an element to a fixed width(1.25rem).Control the text color of an element to yellow-500 using the
text-yellow-500
utilities.Use
h-5
to set an element to a fixed height(1.25rem).
Conclusion
The above is a step-by-step tutorial on how to use Tailwind CSS to create a Dashboard (Not Yet!!!) components, learn and follow along to implement your own components.