Published on

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

Products page with Side Links

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.

Products page with side links from merakiui.com/components

  • 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.

Free download of the Products page with Side Links's source code

<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>

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>
  • 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
  1. Control the background color of an element to white using the bg-white utilities.

  2. Control the background color of an element to gray-900 using the dark:bg-gray-900 utilities in dark theme.

  3. Control the horizontal padding of an element to 1.5rem using the px-6 utilities.

  4. Control the vertical padding of an element to 2rem using the py-8 utilities.

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

  6. Use flex to create a block-level flex container at only large screen sizes.

  7. Control the horizontal margin of an element to -0.5rem at only large screen sizes using the lg:-mx-2 utilities.

  8. Use lg:w-1/5 to set an element to a fixed width(1/5) at only large screen sizes.

  9. Control the horizontal padding of an element to 0.5rem at only large screen sizes using the lg:px-2 utilities.

  10. Use inline utilities to put the element on its own line and fill its parent.

  11. Control the text color of an element to gray-500 using the text-gray-500 utilities.

  12. Control the text color of an element to gray-300 in dark theme using the dark:text-gray-300 utilities.

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

  14. Control the text color of an element to blue-500 in dark theme using the dark:text-blue-500 utilities.

  15. Control the margin on top side of an element to 1.5rem using the mt-6 utilities.

  16. Control the margin on top side of an element to 0rem at only large screen sizes using the lg:mt-0 utilities.

  17. Use lg:w-4/5 to set an element to a fixed width(4/5) at only large screen sizes.

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

  19. Control the text color of an element to sm using the text-sm utilities.

  20. Control the text color of an element to gray-700 using the text-gray-700 utilities.

  21. Control the background color of an element to transparent using the bg-transparent utilities.

  22. Control the text color of an element to gray-500 in dark theme using the dark:text-gray-500 utilities.

  23. Use grid to create a grid container.

  24. Use grid to create a grid container.

  25. To specify the width between columns, you can use the gap-8 utilities.

  26. Control the margin on top side of an element to 2rem using the mt-8 utilities.

  27. Use grid to create a grid container at only medium screen sizes.

  28. Use grid to create a grid container at only large screen sizes.

  29. Use grid to create a grid container at only extremely large screen sizes.

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

  31. Use w-full to set an element to a 100% based width.

  32. Set the maximum width/height of an element using the max-w-lg utilities.

  33. Use h-72 to set an element to a fixed height(18rem).

  34. Use xl:h-80 to set an element to a fixed height(20rem) at only extremely large screen sizes.

  35. Control the margin on top side of an element to 0.5rem using the mt-2 utilities.

  36. Control the text color of an element to lg using the text-lg utilities.

  37. Control the text color of an element to gray-200 in dark theme using the dark:text-gray-200 utilities.

  38. Control the text color of an element to blue-500 using the text-blue-500 utilities.

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

  40. Control the vertical padding of an element to 0.5rem using the py-2 utilities.

  41. Control the margin on top side of an element to 1rem using the mt-4 utilities.

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

  43. Control the background color of an element to gray-800 using the bg-gray-800 utilities.

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

  45. Control the background color of an element to gray-700 using the focus:bg-gray-700 utilities on focus.

  46. Use w-5 to set an element to a fixed width(1.25rem).

  47. Use h-5 to set an element to a fixed height(1.25rem).

  48. 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.