Published on

Surprisingly Effective Ways To Make A Todos App With Tailwind CSS

Todos App

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 Todos App ui component

Todos app

Why use Tailwind CSS to make a Todos App ui component?

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

The preview of Todos App ui component

Free download of the Todos App's source code

The source code of Todos App ui component

<div class="bg-indigo-50 h-screen">
	<nav>
		<div class="w-full bg-gradient-to-tr from-indigo-600 to-purple-600 py-4">
			<h1 class="text-center text-indigo-100 text-xl font-bold">TODO APP</h1>
		</div>
	</nav>
	<div class="px-10 mt-10">
		<div class="bg-white rounded-md max-w-4xl mx-auto p-4 space-y-4 shadow-lg">
			<h3 class="mb-2 font-semibold">Title: <span class="font-thin">Create Todo App</span></p>
				<div class="pt-2">
					<h3 class="font-semibold">Description:</p>
						<p class="font-thin mt-2">Lorem ipsum dolor sit amet consectetur adipisicing elit. Ipsa vitae,
							aliquid deserunt beatae nam est?</p>
				</div>
				<h3 class="border-t mb-2 pt-3 font-semibold">Name: <span class="font-thin">Joker Banny</span></p>
					<h3 class="border-t mb-2 pt-3 font-semibold">Email:
						<span class="font-thin">[email protected]</span></p>
						<div class="flex justify-end space-x-2">
							<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 text-green-500 cursor-pointer" fill="none"
								viewBox="0 0 24 24" stroke="currentColor">
								<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
									d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
								<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
									d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />
							</svg>
							<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 text-indigo-600 cursor-pointer"
								fill="none" viewBox="0 0 24 24" stroke="currentColor">
								<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
									d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" />
							</svg>
							<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 text-red-500 cursor-pointer"
								fill="none" viewBox="0 0 24 24" stroke="currentColor">
								<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
									d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
							</svg>
						</div>
		</div>
	</div>
</div>
</div>

How to make a Todos App with Tailwind CSS?

Install tailwind css of verion 2.2.19

Use the script html tag to import the script of Tailwind CSS of the version 2.2.19

<script src="https://cdn.tailwindcss.com"></script>

All the unility class needed to make a Todos App component

  • bg-indigo-50
  • h-screen
  • w-full
  • bg-gradient-to-tr
  • py-4
  • text-center
  • text-indigo-100
  • text-xl
  • px-10
  • mt-10
  • bg-white
  • max-w-4xl
  • mx-auto
  • p-4
  • mb-2
  • pt-2
  • mt-2
  • border-t
  • pt-3
  • flex
  • h-6
  • w-6
  • text-green-500
  • text-indigo-600
  • text-red-500

25 steps to make a Todos App component with Tailwind CSS

  1. Control the background color of an element to indigo-50 using the bg-indigo-50 utilities.

  2. Use h-screen to make an element span the entire height of the viewport.

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

  4. Control the background color of an element to gradient-to-tr using the bg-gradient-to-tr utilities.

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

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

  7. Control the text color of an element to indigo-100 using the text-indigo-100 utilities.

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

  9. Control the horizontal padding of an element to 2.5rem using the px-10 utilities.

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

  11. Control the background color of an element to white using the bg-white utilities.

  12. Set the maximum width/height of an element using the max-w-4xl utilities.

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

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

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

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

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

  18. Control the border color of an element to t using the border-t utilities.

  19. Control the padding on top side of an element to 0.75rem using the pt-3 utilities.

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

  21. Use h-6 to set an element to a fixed height(1.5rem).

  22. Use w-6 to set an element to a fixed width(1.5rem).

  23. Control the text color of an element to green-500 using the text-green-500 utilities.

  24. Control the text color of an element to indigo-600 using the text-indigo-600 utilities.

  25. Control the text color of an element to red-500 using the text-red-500 utilities.

Conclusion

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