Published on

3 Things You Must Know To Make A To do checklist With Tailwind CSS

Tags
To do checklist

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 To do checklist ui component

Why use Tailwind CSS to make a To do checklist ui component?

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

The preview of To do checklist ui component

Free download of the To do checklist's source code

The source code of To do checklist ui component

<!-- Change the size of the container "max-w-full", ideally to w-1/6-->
<div class="container max-w-full ml-8 mt-6 text-base font-sans">

    <div class="flex flex-col w-full border border-gray-400 shadow-lg overflow-hidden m-auto pb-4">
        <div class="justify-around flex flex-row items-baseline">
            <h1 class="underline text-lg mt-2 ml-3">To do list</h1>
        </div>
        <label class="custom-label flex mt-2 ml-3">
            <div class="bg-white shadow w-6 h-6 p-1 flex justify-center items-center mr-2">
                <input type="checkbox" class="hidden" checked>
                <svg class="hidden w-4 h-4 text-green-600 pointer-events-none" viewBox="0 0 172 172"><g fill="none" stroke-width="none" stroke-miterlimit="10" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode:normal"><path d="M0 172V0h172v172z"/><path d="M145.433 37.933L64.5 118.8658 33.7337 88.0996l-10.134 10.1341L64.5 139.1341l91.067-91.067z" fill="currentColor" stroke-width="1"/></g></svg>
            </div>
            <span class="select-none"> Paint walls</span>
        </label>

        <label class="custom-label flex mt-2 ml-3">
            <div class="bg-white shadow w-6 h-6 p-1 flex justify-center items-center mr-2">
                <input type="checkbox" class="hidden" checked>
                <svg class="hidden w-4 h-4 text-green-600 pointer-events-none" viewBox="0 0 172 172"><g fill="none" stroke-width="none" stroke-miterlimit="10" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode:normal"><path d="M0 172V0h172v172z"/><path d="M145.433 37.933L64.5 118.8658 33.7337 88.0996l-10.134 10.1341L64.5 139.1341l91.067-91.067z" fill="currentColor" stroke-width="1"/></g></svg>
            </div>
            <span class="select-none"> Cleaning</span>
        </label>

        <label class="custom-label flex mt-2 ml-3">
            <div class="bg-white shadow w-6 h-6 p-1 flex justify-center items-center mr-2">
                <input type="checkbox" class="hidden" checked>
                <svg class="hidden w-4 h-4 text-green-600 pointer-events-none" viewBox="0 0 172 172"><g fill="none" stroke-width="none" stroke-miterlimit="10" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode:normal"><path d="M0 172V0h172v172z"/><path d="M145.433 37.933L64.5 118.8658 33.7337 88.0996l-10.134 10.1341L64.5 139.1341l91.067-91.067z" fill="currentColor" stroke-width="1"/></g></svg>
            </div>
            <span class="select-none">Finish project</span>
        </label>

        <label class="custom-label flex mt-2 ml-3">
            <div class="bg-white shadow w-6 h-6 p-1 flex justify-center items-center mr-2">
                <input type="checkbox" class="hidden" checked>
                <svg class="hidden w-4 h-4 text-green-600 pointer-events-none" viewBox="0 0 172 172"><g fill="none" stroke-width="none" stroke-miterlimit="10" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode:normal"><path d="M0 172V0h172v172z"/><path d="M145.433 37.933L64.5 118.8658 33.7337 88.0996l-10.134 10.1341L64.5 139.1341l91.067-91.067z" fill="currentColor" stroke-width="1"/></g></svg>
            </div>
            <span class="select-none">Make dinner</span>
        </label>

        <label class="custom-label flex mt-2 ml-3">
            <div class="bg-white shadow w-6 h-6 p-1 flex justify-center items-center mr-2">
                <input type="checkbox" class="hidden" checked>
                <svg class="hidden w-4 h-4 text-green-600 pointer-events-none" viewBox="0 0 172 172"><g fill="none" stroke-width="none" stroke-miterlimit="10" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode:normal"><path d="M0 172V0h172v172z"/><path d="M145.433 37.933L64.5 118.8658 33.7337 88.0996l-10.134 10.1341L64.5 139.1341l91.067-91.067z" fill="currentColor" stroke-width="1"/></g></svg>
            </div>
            <span class="select-none"> Read a book</span>
        </label>

    </div>

</div>


<style>
    .custom-label input:checked + svg {
        display: block !important;
    }

</style>

How to make a To do checklist with Tailwind CSS?

Install tailwind css of verion 1.3.4

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

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

All the unility class needed to make a To do checklist component

  • max-w-full
  • ml-8
  • mt-6
  • text-base
  • flex
  • flex-col
  • w-full
  • border-gray-400
  • overflow-hidden
  • m-auto
  • pb-4
  • flex-row
  • text-lg
  • mt-2
  • ml-3
  • bg-white
  • w-6
  • h-6
  • p-1
  • mr-2
  • hidden
  • w-4
  • h-4
  • text-green-600

24 steps to make a To do checklist component with Tailwind CSS

  1. Set the maximum width/height of an element using the max-w-full utilities.

  2. Control the margin on left side of an element to 2rem using the ml-8 utilities.

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

  4. Control the text color of an element to base using the text-base utilities.

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

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

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

  8. Control the border color of an element to gray-400 using the border-gray-400 utilities.

  9. Use overflow-hidden to clip any content within an element that overflows the bounds of that element.

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

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

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

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

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

  15. Control the margin on left side of an element to 0.75rem using the ml-3 utilities.

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

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

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

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

  20. Control the margin on right side of an element to 0.5rem using the mr-2 utilities.

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

  22. Use w-4 to set an element to a fixed width(1rem).

  23. Use h-4 to set an element to a fixed height(1rem).

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

Conclusion

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