Published on

How To Make A Reset password With Tailwind CSS From Scratch

Reset password

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 Reset password ui component

A elegant reset password form + social

Why use Tailwind CSS to make a Reset password ui component?

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

The preview of Reset password ui component

Free download of the Reset password's source code

The source code of Reset password ui component

<div class="flex justify-center min-h-screen bg-gray-100 antialiased">  
  <div class="container sm:mt-40 mt-24 my-auto max-w-md border-2 border-gray-200 p-3 bg-white">
    <!-- header -->  
    <div class="text-center m-6">
      <h1 class="text-3xl font-semibold text-gray-700">Forgot your password?</h1>
      <p class="text-gray-500">Just enter your email address below and we'll send you a link to reset your password!</p>
    </div>
    <!-- sign-in -->
    <div class="m-6">
      <form class="mb-4">
        <div class="mb-6">
          <label for="email" class="block mb-2 text-sm text-gray-600 dark:text-gray-400">Email Address</label>
          <input type="email" name="email" id="email" placeholder="Your email address" class="w-full px-3 py-2 placeholder-gray-300 border border-gray-300 rounded-md focus:outline-none focus:ring focus:ring-indigo-100 focus:border-indigo-300 dark:bg-gray-700 dark:text-white dark:placeholder-gray-500 dark:border-gray-600 dark:focus:ring-gray-900 dark:focus:border-gray-500" />
        </div>
        <div class="mb-6">
          <button type="button" class="w-full px-3 py-4 text-white bg-indigo-500 rounded-md hover:bg-indigo-600 focus:outline-none duration-100 ease-in-out">Send reset link</button>
        </div>
        <p class="text-sm text-center text-gray-400">
          Don&#x27;t have an account yet? 
          <a href="#!" class="font-semibold text-indigo-500 focus:text-indigo-600 focus:outline-none focus:underline">Sign up</a>.
        </p>
      </form>
      <!-- seperator -->  
      <div class="flex flex-row justify-center mb-8">
        <span class="absolute bg-white px-4 text-gray-500">or sign-in with</span>
        <div class="w-full bg-gray-200 mt-3 h-px"></div>
      </div>
      <!-- alternate sign-in -->  
      <div class="flex flex-row gap-2">
        <button class="bg-green-500 text-white w-full p-2 flex flex-row justify-center gap-2 items-center rounded-sm hover:bg-green-600 duration-100 ease-in-out">
          <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" class="w-5" viewBox="0 0 48 48"><defs><path id="a" d="M44.5 20H24v8.5h11.8C34.7 33.9 30.1 37 24 37c-7.2 0-13-5.8-13-13s5.8-13 13-13c3.1 0 5.9 1.1 8.1 2.9l6.4-6.4C34.6 4.1 29.6 2 24 2 11.8 2 2 11.8 2 24s9.8 22 22 22c11 0 21-8 21-22 0-1.3-.2-2.7-.5-4z"/></defs><clipPath id="b"><use xlink:href="#a" overflow="visible"/></clipPath><path clip-path="url(#b)" fill="#FBBC05" d="M0 37V11l17 13z"/><path clip-path="url(#b)" fill="#EA4335" d="M0 11l17 13 7-6.1L48 14V0H0z"/><path clip-path="url(#b)" fill="#34A853" d="M0 37l30-23 7.9 1L48 0v48H0z"/><path clip-path="url(#b)" fill="#4285F4" d="M48 48L17 24l-4-3 35-10z"/></svg>
          Google
        </button>
        <button class="bg-gray-700 text-white w-full p-2 flex flex-row justify-center gap-2 items-center rounded-sm hover:bg-gray-800 duration-100 ease-in-out">
          <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="w-5" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385c.6.105.825-.255.825-.57c0-.285-.015-1.23-.015-2.235c-3.015.555-3.795-.735-4.035-1.41c-.135-.345-.72-1.41-1.23-1.695c-.42-.225-1.02-.78-.015-.795c.945-.015 1.62.87 1.845 1.23c1.08 1.815 2.805 1.305 3.495.99c.105-.78.42-1.305.765-1.605c-2.67-.3-5.46-1.335-5.46-5.925c0-1.305.465-2.385 1.23-3.225c-.12-.3-.54-1.53.12-3.18c0 0 1.005-.315 3.3 1.23c.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23c.66 1.65.24 2.88.12 3.18c.765.84 1.23 1.905 1.23 3.225c0 4.605-2.805 5.625-5.475 5.925c.435.375.81 1.095.81 2.22c0 1.605-.015 2.895-.015 3.3c0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z" fill="currentColor"/></g></svg>
          Github
        </button>
      </div>  
    </div>
  </div>
</div>

How to make a Reset password 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 Reset password component

  • flex
  • min-h-screen
  • bg-gray-100
  • sm:mt-40
  • mt-24
  • my-auto
  • max-w-md
  • border-2
  • border-gray-200
  • p-3
  • bg-white
  • text-center
  • m-6
  • text-3xl
  • text-gray-700
  • text-gray-500
  • mb-4
  • mb-6
  • block
  • mb-2
  • text-sm
  • text-gray-600
  • dark:text-gray-400
  • w-full
  • px-3
  • py-2
  • border-gray-300
  • focus:border-indigo-300
  • dark:bg-gray-700
  • dark:text-white
  • dark:border-gray-600
  • py-4
  • text-white
  • bg-indigo-500
  • hover:bg-indigo-600
  • text-gray-400
  • text-indigo-500
  • focus:text-indigo-600
  • flex-row
  • mb-8
  • absolute
  • px-4
  • bg-gray-200
  • mt-3
  • h-px
  • gap-2
  • bg-green-500
  • p-2
  • hover:bg-green-600
  • w-5
  • bg-gray-700
  • hover:bg-gray-800

52 steps to make a Reset password component with Tailwind CSS

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

  2. Set the minimum width/height of an element using the min-h-screen utilities.

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

  4. Control the margin on top side of an element to 10rem at only small screen sizes using the sm:mt-40 utilities.

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

  6. Control the vertical margin of an element to auto using the my-auto utilities.

  7. Set the maximum width/height of an element using the max-w-md utilities.

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

  9. Control the border color of an element to gray-200 using the border-gray-200 utilities.

  10. Control the padding on all sides of an element to 0.75rem using the p-3 utilities.

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

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

  13. Control the margin on all sides of an element to 1.5rem using the m-6 utilities.

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

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

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

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

  18. Control the margin on bottom side of an element to 1.5rem using the mb-6 utilities.

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

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

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

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

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

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

  25. Control the horizontal padding of an element to 0.75rem using the px-3 utilities.

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

  27. Control the border color of an element to gray-300 using the border-gray-300 utilities.

  28. Control the border color of an element to indigo-300 using the focus:border-indigo-300 utilities on focus.

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

  30. Control the text color of an element to white in dark theme using the dark:text-white utilities.

  31. Control the border color of an element to gray-600 using the dark:border-gray-600 utilities in dark theme.

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

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

  34. Control the background color of an element to indigo-500 using the bg-indigo-500 utilities.

  35. Control the background color of an element to indigo-600 using the hover:bg-indigo-600 utilities on hover.

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

  37. Control the text color of an element to indigo-500 using the text-indigo-500 utilities.

  38. Control the text color of an element to indigo-600 on focus using the focus:text-indigo-600 utilities.

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

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

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

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

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

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

  45. Use h-px to set an element to a fixed height(px).

  46. To specify the width between columns, you can use the gap-2 utilities.

  47. Control the background color of an element to green-500 using the bg-green-500 utilities.

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

  49. Control the background color of an element to green-600 using the hover:bg-green-600 utilities on hover.

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

  51. Control the background color of an element to gray-700 using the bg-gray-700 utilities.

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

Conclusion

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