- Published on
Ways To Create A Products Page With Side Links With Tailwind CSS In 60 Minutes

- What is Tailwind CSS?
- The description of Products page with Side Links ui component
- Why use Tailwind CSS to create a Products page with Side Links ui component?
- The preview of Products page with Side Links ui component
- The source code of Products page with Side Links ui component
- How to create a Products page with Side Links with Tailwind CSS?
- Install tailwind css of verion 3.0.18
- All the unility class needed to create a Products page with Side Links component
- 48 steps to create a Products page with Side Links 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 Products page with Side Links ui component
Products page with side links from merakiui.com/components
Why use Tailwind CSS to create a Products page with Side Links ui component?
- It can make the building process of Products page with Side Links ui component faster and more easily.
- Enables building complex responsive layouts and components freely.
- Minimum lines of CSS code in Products page with Side Links component file.
The preview of Products page with Side Links ui component
Free download of the Products page with Side Links's source code
The source code of Products page with Side Links ui component
<section class="bg-white dark:bg-gray-900">
<div class="container px-6 py-8 mx-auto">
<div class="lg:flex lg:-mx-2">
<div class="space-y-3 lg:w-1/5 lg:px-2 lg:space-y-4">
<a href="#" class="block font-medium text-gray-500 dark:text-gray-300 hover:underline">Jackets & Coats</a>
<a href="#" class="block font-medium text-gray-500 dark:text-gray-300 hover:underline">Hoodies</a>
<a href="#" class="block font-medium text-blue-600 dark:text-blue-500 hover:underline">T-shirts & Vests</a>
<a href="#" class="block font-medium text-gray-500 dark:text-gray-300 hover:underline">Shirts</a>
<a href="#" class="block font-medium text-gray-500 dark:text-gray-300 hover:underline">Blazers & Suits</a>
<a href="#" class="block font-medium text-gray-500 dark:text-gray-300 hover:underline">Jeans</a>
<a href="#" class="block font-medium text-gray-500 dark:text-gray-300 hover:underline">Trousers</a>
<a href="#" class="block font-medium text-gray-500 dark:text-gray-300 hover:underline">Shorts</a>
<a href="#" class="block font-medium text-gray-500 dark:text-gray-300 hover:underline">Underwear</a>
</div>
<div class="mt-6 lg:mt-0 lg:px-2 lg:w-4/5 ">
<div class="flex items-center justify-between text-sm tracking-widest uppercase ">
<p class="text-gray-500 dark:text-gray-300">6 Items</p>
<div class="flex items-center">
<p class="text-gray-500 dark:text-gray-300">Sort</p>
<select class="font-medium text-gray-700 bg-transparent dark:text-gray-500 focus:outline-none">
<option value="#">Recommended</option>
<option value="#">Size</option>
<option value="#">Price</option>
</select>
</div>
</div>
<div class="grid grid-cols-1 gap-8 mt-8 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4">
<div class="flex flex-col items-center justify-center w-full max-w-lg mx-auto">
<img class="object-cover w-full rounded-md h-72 xl:h-80" src="https://images.unsplash.com/photo-1583743814966-8936f5b7be1a?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=634&q=80" alt="T-Shirt">
<h4 class="mt-2 text-lg font-medium text-gray-700 dark:text-gray-200">Printed T-shirt</h4>
<p class="text-blue-500">$12.55</p>
<button class="flex items-center justify-center w-full px-2 py-2 mt-4 font-medium tracking-wide text-white capitalize transition-colors duration-200 transform bg-gray-800 rounded-md hover:bg-gray-700 focus:outline-none focus:bg-gray-700">
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 mx-1" viewBox="0 0 20 20" fill="currentColor">
<path d="M3 1a1 1 0 000 2h1.22l.305 1.222a.997.997 0 00.01.042l1.358 5.43-.893.892C3.74 11.846 4.632 14 6.414 14H15a1 1 0 000-2H6.414l1-1H14a1 1 0 00.894-.553l3-6A1 1 0 0017 3H6.28l-.31-1.243A1 1 0 005 1H3zM16 16.5a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0zM6.5 18a1.5 1.5 0 100-3 1.5 1.5 0 000 3z" />
</svg>
<span class="mx-1">Add to cart</span>
</button>
</div>
<div class="flex flex-col items-center justify-center w-full max-w-lg mx-auto">
<img class="object-cover w-full rounded-md h-72 xl:h-80" src="https://images.unsplash.com/photo-1620799139507-2a76f79a2f4d?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=966&q=80" alt="T-Shirt">
<h4 class="mt-2 text-lg font-medium text-gray-700 dark:text-gray-200"> Slub jersey T-shirt</h4>
<p class="text-blue-500">$18.70</p>
<button class="flex items-center justify-center w-full px-2 py-2 mt-4 font-medium tracking-wide text-white capitalize transition-colors duration-200 transform bg-gray-800 rounded-md hover:bg-gray-700 focus:outline-none focus:bg-gray-700">
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 mx-1" viewBox="0 0 20 20" fill="currentColor">
<path d="M3 1a1 1 0 000 2h1.22l.305 1.222a.997.997 0 00.01.042l1.358 5.43-.893.892C3.74 11.846 4.632 14 6.414 14H15a1 1 0 000-2H6.414l1-1H14a1 1 0 00.894-.553l3-6A1 1 0 0017 3H6.28l-.31-1.243A1 1 0 005 1H3zM16 16.5a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0zM6.5 18a1.5 1.5 0 100-3 1.5 1.5 0 000 3z" />
</svg>
<span class="mx-1">Add to cart</span>
</button>
</div>
<div class="flex flex-col items-center justify-center w-full max-w-lg mx-auto">
<img class="object-cover w-full rounded-md h-72 xl:h-80" src="https://images.unsplash.com/photo-1603320409990-02d834987237?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=634&q=80" alt="T-Shirt">
<h4 class="mt-2 text-lg font-medium text-gray-700 dark:text-gray-200">T-shirt with a motif</h4>
<p class="text-blue-500">$16.55</p>
<button class="flex items-center justify-center w-full px-2 py-2 mt-4 font-medium tracking-wide text-white capitalize transition-colors duration-200 transform bg-gray-800 rounded-md hover:bg-gray-700 focus:outline-none focus:bg-gray-700">
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 mx-1" viewBox="0 0 20 20" fill="currentColor">
<path d="M3 1a1 1 0 000 2h1.22l.305 1.222a.997.997 0 00.01.042l1.358 5.43-.893.892C3.74 11.846 4.632 14 6.414 14H15a1 1 0 000-2H6.414l1-1H14a1 1 0 00.894-.553l3-6A1 1 0 0017 3H6.28l-.31-1.243A1 1 0 005 1H3zM16 16.5a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0zM6.5 18a1.5 1.5 0 100-3 1.5 1.5 0 000 3z" />
</svg>
<span class="mx-1">Add to cart</span>
</button>
</div>
<div class="flex flex-col items-center justify-center w-full max-w-lg mx-auto">
<img class="object-cover w-full rounded-md h-72 xl:h-80" src="https://images.unsplash.com/photo-1603320410149-db26b12d5c2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=634&q=80" alt="T-Shirt">
<h4 class="mt-2 text-lg font-medium text-gray-700 dark:text-gray-200">Art T-shirt</h4>
<p class="text-blue-500">$12.55</p>
<button class="flex items-center justify-center w-full px-2 py-2 mt-4 font-medium tracking-wide text-white capitalize transition-colors duration-200 transform bg-gray-800 rounded-md hover:bg-gray-700 focus:outline-none focus:bg-gray-700">
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 mx-1" viewBox="0 0 20 20" fill="currentColor">
<path d="M3 1a1 1 0 000 2h1.22l.305 1.222a.997.997 0 00.01.042l1.358 5.43-.893.892C3.74 11.846 4.632 14 6.414 14H15a1 1 0 000-2H6.414l1-1H14a1 1 0 00.894-.553l3-6A1 1 0 0017 3H6.28l-.31-1.243A1 1 0 005 1H3zM16 16.5a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0zM6.5 18a1.5 1.5 0 100-3 1.5 1.5 0 000 3z" />
</svg>
<span class="mx-1">Add to cart</span>
</button>
</div>
</div>
</div>
</div>
</div>
</section>
How to create a Products page with Side Links 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 create a Products page with Side Links component
bg-white
dark:bg-gray-900
px-6
py-8
mx-auto
lg:flex
lg:-mx-2
lg:w-1/5
lg:px-2
block
text-gray-500
dark:text-gray-300
text-blue-600
dark:text-blue-500
mt-6
lg:mt-0
lg:w-4/5
flex
text-sm
text-gray-700
bg-transparent
dark:text-gray-500
grid
grid-cols-1
gap-8
mt-8
md:grid-cols-2
lg:grid-cols-3
xl:grid-cols-4
flex-col
w-full
max-w-lg
h-72
xl:h-80
mt-2
text-lg
dark:text-gray-200
text-blue-500
px-2
py-2
mt-4
text-white
bg-gray-800
hover:bg-gray-700
focus:bg-gray-700
w-5
h-5
mx-1
48 steps to create a Products page with Side Links component with Tailwind CSS
Control the background color of an element to white using the
bg-white
utilities.Control the background color of an element to gray-900 using the
dark:bg-gray-900
utilities in dark theme.Control the horizontal padding of an element to 1.5rem using the
px-6
utilities.Control the vertical padding of an element to 2rem using the
py-8
utilities.Control the horizontal margin of an element to auto using the
mx-auto
utilities.Use
flex
to create a block-level flex container at only large screen sizes.Control the horizontal margin of an element to -0.5rem at only large screen sizes using the
lg:-mx-2
utilities.Use
lg:w-1/5
to set an element to a fixed width(1/5) at only large screen sizes.Control the horizontal padding of an element to 0.5rem at only large screen sizes using the
lg:px-2
utilities.Use
inline
utilities to put the element on its own line and fill its parent.Control the text color of an element to gray-500 using the
text-gray-500
utilities.Control the text color of an element to gray-300 in dark theme using the
dark:text-gray-300
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 blue-500 in dark theme using the
dark:text-blue-500
utilities.Control the margin on top side of an element to 1.5rem using the
mt-6
utilities.Control the margin on top side of an element to 0rem at only large screen sizes using the
lg:mt-0
utilities.Use
lg:w-4/5
to set an element to a fixed width(4/5) at only large screen sizes.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 background color of an element to transparent using the
bg-transparent
utilities.Control the text color of an element to gray-500 in dark theme using the
dark:text-gray-500
utilities.Use
grid
to create a grid container.Use
grid
to create a grid container.To specify the width between columns, you can use the
gap-8
utilities.Control the margin on top side of an element to 2rem using the
mt-8
utilities.Use
grid
to create a grid container at only medium screen sizes.Use
grid
to create a grid container at only large screen sizes.Use
grid
to create a grid container at only extremely large screen sizes.Use
flex
to create a block-level flex container.Use
w-full
to set an element to a 100% based width.Set the maximum width/height of an element using the
max-w-lg
utilities.Use
h-72
to set an element to a fixed height(18rem).Use
xl:h-80
to set an element to a fixed height(20rem) at only extremely large screen sizes.Control the margin on top side of an element to 0.5rem using the
mt-2
utilities.Control the text color of an element to lg using the
text-lg
utilities.Control the text color of an element to gray-200 in dark theme using the
dark:text-gray-200
utilities.Control the text color of an element to blue-500 using the
text-blue-500
utilities.Control the horizontal padding of an element to 0.5rem using the
px-2
utilities.Control the vertical padding of an element to 0.5rem using the
py-2
utilities.Control the margin on top side of an element to 1rem using the
mt-4
utilities.Control the text color of an element to white using the
text-white
utilities.Control the background color of an element to gray-800 using the
bg-gray-800
utilities.Control the background color of an element to gray-700 using the
hover:bg-gray-700
utilities on hover.Control the background color of an element to gray-700 using the
focus:bg-gray-700
utilities on focus.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 horizontal margin of an element to 0.25rem using the
mx-1
utilities.
Conclusion
The above is a step-by-step tutorial on how to use Tailwind CSS to create a Products page with Side Links components, learn and follow along to implement your own components.