Published on

6 Steps To Make A Todo List With Tailwind CSS Like A Pro In Under An Hour

Todo List

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 Todo List ui component

Todo list

Why use Tailwind CSS to make a Todo List ui component?

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

The preview of Todo List ui component

Free download of the Todo List's source code

The source code of Todo List ui component

<div class="bg-slate-100 h-screen">
	<nav class="w-full bg-yellow-400 py-4">
		<h1 class="text-center text-2xl font-bold">TODO LIST</h1>
	</nav>
	<div class="flex flex-col w-full pt-28 items-center justify-center">
		<div>
			<form class="bg-white rounded-md py-10 px-12 shadow-lg">
				<h1 class="text-xl mt-2 text-center font-semibold text-gray-600">Whrite Todo List</h1>
				<div class="mt-6 flex space-x-4 m-10 justify-center">
					<input type="number" placeholder="0" min="0" class="cursor-pointer bg-gray-100 w-10 text-center rounded-md pl-2 outline-none py-2 border-2" />
					<input placeholder="write her..." class="bg-gray-100 rounded-md py-2 px-4 border-2 outline-none"/>
					<button class="bg-yellow-400 px-4 rounded-md font-semibold">Send</button>
				</div>
				</p>
		</form>
				<p class="mt-6 bg-white p-6 rounded-md text-gray-500 shadow-lg"> simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the
				<p class="mt-6 bg-white p-6 rounded-md text-gray-500 shadow-lg"> simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the
				<p class="mt-6 bg-white p-6 rounded-md text-gray-500 shadow-lg"> simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the
		</div>
		</section>
		<p class="absolute bottom-14 right-14 bg-yellow-400 py-2 px-4 rounded-full text-lg font-bold">?</p>
	</div>
</div>

How to make a Todo List 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 make a Todo List component

  • bg-slate-100
  • h-screen
  • w-full
  • bg-yellow-400
  • py-4
  • text-center
  • text-2xl
  • flex
  • flex-col
  • pt-28
  • bg-white
  • py-10
  • px-12
  • text-xl
  • mt-2
  • text-gray-600
  • mt-6
  • m-10
  • bg-gray-100
  • w-10
  • pl-2
  • py-2
  • border-2
  • px-4
  • p-6
  • text-gray-500
  • absolute
  • bottom-14
  • right-14
  • text-lg

30 steps to make a Todo List component with Tailwind CSS

  1. Control the background color of an element to slate-100 using the bg-slate-100 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 yellow-400 using the bg-yellow-400 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 2xl using the text-2xl utilities.

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

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

  10. Control the padding on top side of an element to 7rem using the pt-28 utilities.

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

  12. Control the vertical padding of an element to 2.5rem using the py-10 utilities.

  13. Control the horizontal padding of an element to 3rem using the px-12 utilities.

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

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

  16. Control the text color of an element to gray-600 using the text-gray-600 utilities.

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

  18. Control the margin on all sides of an element to 2.5rem using the m-10 utilities.

  19. Control the background color of an element to gray-100 using the bg-gray-100 utilities.

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

  21. Set the left padding of an element to 0.5rem using the pl-2 utilities class

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

  23. Control the border color of an element to 0.5rem using the border-2 utilities.

  24. Control the horizontal padding of an element to 1rem using the px-4 utilities.

  25. Control the padding on all sides of an element to 1.5rem using the p-6 utilities.

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

  27. Use absolute to position an element outside of the normal flow of the document, causing neighboring elements to act as if the element doesn’t exist.

  28. Use the bottom-14 utilities to set the bottom position of a positioned element to 3.5rem.

  29. Use the right-14 utilities to set the right position of a positioned element to 3.5rem.

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

Conclusion

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