Published on

The Ultimate Guide To Help You Build A Simple template With Tailwind CSS

Tags
Simple template

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 Simple template ui component

Simple template inspired in leno landing page

Why use Tailwind CSS to build a Simple template ui component?

  • It can make the building process of Simple template ui component faster and more easily.
  • Enables building complex responsive layouts and components freely.
  • Minimum lines of CSS code in Simple template component file.

The preview of Simple template ui component

Free download of the Simple template's source code

The source code of Simple template ui component

<div class="text-white mt-0 border border-blue-800 py-0 w-full h-full" style="background-image:url('https://demos.onepagelove.com/html/leno/images/header-background.jpg')">
    <header class="flex md:justify-between p-8">
        <div class="flex align-items-center">
            <svg class="sm:w-12 w-10 inline mr-3" fill="#00c9db" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 586.5 586.5"  xml:space="preserve"><polygon points="471.75,89.25 369.75,89.25 168.3,410.55 102,293.25 216.75,89.25 114.75,89.25 0,293.25 114.75,497.25 216.75,497.25 418.2,175.95 484.5,293.25 369.75,497.25 471.75,497.25 586.5,293.25"/></svg>
            <h1 class="inline text-white sm:text-3xl text-2xl font-bold"><a href="/">My Company</a></h1>
        </div>
        <div class="lg:flex md:text-white hidden">
            <ul class="align-items-center pt-2">
                <li class="ml-4 p4"><a href="">Home</a></li>
                <li class="ml-4 p4"><a href="">Features</a></li>
                <li class="ml-4 p4"><a href="">Details</a></li>
                <li class="ml-4 p4"><a href="">Preview</a></li>
                <li class="ml-4 p4"><a href="">Contact</a></li>
            </ul>
        </div>
    </header>
    <section class="px-2 lg:px-0 mt-16 sm:mt-32 flex w-full container mx-auto pb-16">
        <div class="w-full text-white flex justify-center md:justify-start text-center md:text-left">
            <div class="md:w-1/2 w-full">
                <h2 class="leading-none font-bold text-2xl xs:text-2x1 md:text-5xl lg:6x1 uppercase">Mobile app for <span class="text-blue-400">Marketers</span></h2>
                <p class="mt-12 mb-12">This Landing is one is one of the easiest and feature packed marketing automation apps in the market. Download it today!</p>
                <button class="px-16 rounded-full bg-blue-400 text-white font-bold p-4 uppercase border-blue-500 border">Download Now!</button>
            </div>
            <div class="md:w-1/2 md:justify-center md:flex hidden">
                <img src="https://demos.onepagelove.com/html/leno/images/header-iphone.png" alt="Mobile Phone" />
            </div>
        </div>
    </section>
    <section class="bg-gray-900 sm:py-32 py-16">
        <div class="container mx-auto sm:flex-row flex-col flex ">
            <div class="sm:w-1/3 w-full sm:mb-0 mb-16">
                <img src="https://demos.onepagelove.com/html/leno/images/testimonial-1.jpg" class="rounded-full w-24 h-24 mx-auto mb-2">
                <p class="italic text-gray-500 text-center my-3">I just finished my trial period and was so amazed with the support and results that I purchased this template.</p>
                <p class="font-bold  text-gray-400 text-center text-xl">Sandy Grain - Designer</p>
            </div>
            <div class="sm:w-1/3 w-full sm:mb-0 mb-16">
                <img src="https://demos.onepagelove.com/html/leno/images/testimonial-2.jpg" class="rounded-full w-24 h-24 mx-auto mb-2">
                <p class="italic text-gray-500 text-center my-3">Searching for a great marketing automation app was difficult but thankfully I found this template.</p>
                <p class="font-bold  text-gray-400 text-center text-xl">Bruce Cashman - Developer</p>
            </div>
            <div class="sm:w-1/3 w-full sm:mb-0 mb-16">
                <img src="https://demos.onepagelove.com/html/leno/images/testimonial-3.jpg" class="rounded-full w-24 h-24 mx-auto mb-2">
                <p class="italic text-gray-500 text-center my-3">Who would have thought that this template can provide such amazing results in just a few weeks of use.</p>
                <p class="font-bold  text-gray-400 text-center text-xl">Amanda Savage - Administrator</p>
            </div>
        </div>
    </section>
    <section class="bg-gray-800 py-32">
        <div class="container mx-auto">
            <h1 class="text-5xl font-bold uppercase text-center text-gray-300">Features</h1>
            <div class="flex justify-center">
                <p class="w-1/2 text-center text-gray-300">This template was designed based on input from personal development coaches and popular trainers so it offers all</p>
            </div>
        </div>
    </section>
</div>

How to build a Simple template with Tailwind CSS?

Install tailwind css of verion 1.0.4

Use the link html tag to import the stylesheet of Tailwind CSS of the version 1.0.4

<link href=https://unpkg.com/[email protected]/dist/tailwind.min.css rel="stylesheet">

All the unility class needed to build a Simple template component

  • text-white
  • mt-0
  • border-blue-800
  • py-0
  • w-full
  • h-full
  • flex
  • p-8
  • sm:w-12
  • w-10
  • inline
  • mr-3
  • sm:text-3xl
  • text-2xl
  • lg:flex
  • md:text-white
  • hidden
  • pt-2
  • ml-4
  • px-2
  • lg:px-0
  • mt-16
  • sm:mt-32
  • mx-auto
  • pb-16
  • md:justify-start
  • text-center
  • md:text-left
  • md:w-1/2
  • xs:text-2x1
  • md:text-5xl
  • text-blue-400
  • mt-12
  • mb-12
  • px-16
  • bg-blue-400
  • p-4
  • border-blue-500
  • md:flex
  • bg-gray-900
  • sm:py-32
  • py-16
  • sm:flex-row
  • flex-col
  • sm:w-1/3
  • sm:mb-0
  • mb-16
  • w-24
  • h-24
  • mb-2
  • text-gray-500
  • my-3
  • text-gray-400
  • text-xl
  • bg-gray-800
  • py-32
  • text-5xl
  • text-gray-300
  • w-1/2

59 steps to build a Simple template component with Tailwind CSS

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

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

  3. Control the border color of an element to blue-800 using the border-blue-800 utilities.

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

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

  6. Use h-full to set an element’s height to 100% of its parent, as long as the parent has a defined height.

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

  8. Control the padding on all sides of an element to 2rem using the p-8 utilities.

  9. Use sm:w-12 to set an element to a fixed width(3rem) at only small screen sizes.

  10. Use w-10 to set an element to a fixed width(2.5rem).

  11. Use inline utilities to control the flow of text inside the element to wrap normally.

  12. Control the margin on right side of an element to 0.75rem using the mr-3 utilities.

  13. Control the text color of an element to 3xl at only small screen sizes using the sm:text-3xl utilities.

  14. Control the text color of an element to 2xl using the text-2xl utilities.

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

  16. Control the text color of an element to white at only medium screen sizes using the md:text-white utilities.

  17. Use hidden to set an element to display: none and remove it from the page layout.

  18. Control the padding on top side of an element to 0.5rem using the pt-2 utilities.

  19. Control the margin on left side of an element to 1rem using the ml-4 utilities.

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

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

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

  23. Control the margin on top side of an element to 8rem at only small screen sizes using the sm:mt-32 utilities.

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

  25. Control the padding on bottom side of an element to 4rem using the pb-16 utilities.

  26. Use justify-start to justify items against the start of the container’s main axis at only medium screen sizes.

  27. Control the text color of an element to center using the text-center utilities.

  28. Control the text color of an element to left at only medium screen sizes using the md:text-left utilities.

  29. Use md:w-1/2 to set an element to a fixed width(1/2) at only medium screen sizes.

  30. Control the text color of an element to 2x1undefined using the xs:text-2x1 utilities.

  31. Control the text color of an element to 5xl at only medium screen sizes using the md:text-5xl utilities.

  32. Control the text color of an element to blue-400 using the text-blue-400 utilities.

  33. Control the margin on top side of an element to 3rem using the mt-12 utilities.

  34. Control the margin on bottom side of an element to 3rem using the mb-12 utilities.

  35. Control the horizontal padding of an element to 4rem using the px-16 utilities.

  36. Control the background color of an element to blue-400 using the bg-blue-400 utilities.

  37. Control the padding on all sides of an element to 1rem using the p-4 utilities.

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

  39. Use flex to create a block-level flex container at only medium screen sizes.

  40. Control the background color of an element to gray-900 using the bg-gray-900 utilities.

  41. Control the vertical padding of an element to 8rem at only small screen sizes using the sm:py-32 utilities.

  42. Control the vertical padding of an element to 4rem using the py-16 utilities.

  43. Use flex to create a block-level flex container at only small screen sizes.

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

  45. Use sm:w-1/3 to set an element to a fixed width(1/3) at only small screen sizes.

  46. Control the margin on bottom side of an element to 0rem at only small screen sizes using the sm:mb-0 utilities.

  47. Control the margin on bottom side of an element to 4rem using the mb-16 utilities.

  48. Use w-24 to set an element to a fixed width(6rem).

  49. Use h-24 to set an element to a fixed height(6rem).

  50. Control the margin on bottom side of an element to 0.5rem using the mb-2 utilities.

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

  52. Control the vertical margin of an element to 0.75rem using the my-3 utilities.

  53. Control the text color of an element to gray-400 using the text-gray-400 utilities.

  54. Control the text color of an element to xl using the text-xl utilities.

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

  56. Control the vertical padding of an element to 8rem using the py-32 utilities.

  57. Control the text color of an element to 5xl using the text-5xl utilities.

  58. Control the text color of an element to gray-300 using the text-gray-300 utilities.

  59. Use w-1/2 to set an element to a fixed width(1/2).

Conclusion

The above is a step-by-step tutorial on how to use Tailwind CSS to build a Simple template components, learn and follow along to implement your own components.