Published on

6 Tips To Make A Login And Registration With Image With Tailwind CSS

Login and registration with image

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 Login and registration with image ui component

A login and registration with image for tailwind ccss

Why use Tailwind CSS to build a Login and registration with image ui component?

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

The preview of Login and registration with image ui component

Free download of the Login and registration with image's source code

The source code of Login and registration with image ui component

<div class="py-6">
  <div class="flex bg-white rounded-lg shadow-lg overflow-hidden mx-auto max-w-sm lg:max-w-4xl">
        <div class="hidden lg:block lg:w-1/2 bg-cover" style="background-image:url('https://images.unsplash.com/photo-1546514714-df0ccc50d7bf?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=667&q=80')"></div>
        <div class="w-full p-8 lg:w-1/2">
            <h2 class="text-2xl font-semibold text-gray-700 text-center">Brand</h2>
            <p class="text-xl text-gray-600 text-center">Welcome back!</p>
            <a href="#" class="flex items-center justify-center mt-4 text-white rounded-lg shadow-md hover:bg-gray-100">
                <div class="px-4 py-3">
                    <svg class="h-6 w-6" viewBox="0 0 40 40">
                        <path d="M36.3425 16.7358H35V16.6667H20V23.3333H29.4192C28.045 27.2142 24.3525 30 20 30C14.4775 30 10 25.5225 10 20C10 14.4775 14.4775 9.99999 20 9.99999C22.5492 9.99999 24.8683 10.9617 26.6342 12.5325L31.3483 7.81833C28.3717 5.04416 24.39 3.33333 20 3.33333C10.7958 3.33333 3.33335 10.7958 3.33335 20C3.33335 29.2042 10.7958 36.6667 20 36.6667C29.2042 36.6667 36.6667 29.2042 36.6667 20C36.6667 18.8825 36.5517 17.7917 36.3425 16.7358Z" fill="#FFC107"/>
                        <path d="M5.25497 12.2425L10.7308 16.2583C12.2125 12.59 15.8008 9.99999 20 9.99999C22.5491 9.99999 24.8683 10.9617 26.6341 12.5325L31.3483 7.81833C28.3716 5.04416 24.39 3.33333 20 3.33333C13.5983 3.33333 8.04663 6.94749 5.25497 12.2425Z" fill="#FF3D00"/>
                        <path d="M20 36.6667C24.305 36.6667 28.2167 35.0192 31.1742 32.34L26.0159 27.975C24.3425 29.2425 22.2625 30 20 30C15.665 30 11.9842 27.2359 10.5975 23.3784L5.16254 27.5659C7.92087 32.9634 13.5225 36.6667 20 36.6667Z" fill="#4CAF50"/>
                        <path d="M36.3425 16.7358H35V16.6667H20V23.3333H29.4192C28.7592 25.1975 27.56 26.805 26.0133 27.9758C26.0142 27.975 26.015 27.975 26.0158 27.9742L31.1742 32.3392C30.8092 32.6708 36.6667 28.3333 36.6667 20C36.6667 18.8825 36.5517 17.7917 36.3425 16.7358Z" fill="#1976D2"/>
                    </svg>
                </div>
                <h1 class="px-4 py-3 w-5/6 text-center text-gray-600 font-bold">Sign in with Google</h1>
            </a>
            <div class="mt-4 flex items-center justify-between">
                <span class="border-b w-1/5 lg:w-1/4"></span>
                <a href="#" class="text-xs text-center text-gray-500 uppercase">or login with email</a>
                <span class="border-b w-1/5 lg:w-1/4"></span>
            </div>
            <div class="mt-4">
                <label class="block text-gray-700 text-sm font-bold mb-2">Email Address</label>
                <input class="bg-gray-200 text-gray-700 focus:outline-none focus:shadow-outline border border-gray-300 rounded py-2 px-4 block w-full appearance-none" type="email">
            </div>
            <div class="mt-4">
                <div class="flex justify-between">
                    <label class="block text-gray-700 text-sm font-bold mb-2">Password</label>
                    <a href="#" class="text-xs text-gray-500">Forget Password?</a>
                </div>
                <input class="bg-gray-200 text-gray-700 focus:outline-none focus:shadow-outline border border-gray-300 rounded py-2 px-4 block w-full appearance-none" type="password">
            </div>
            <div class="mt-8">
                <button class="bg-gray-700 text-white font-bold py-2 px-4 w-full rounded hover:bg-gray-600">Login</button>
            </div>
            <div class="mt-4 flex items-center justify-between">
                <span class="border-b w-1/5 md:w-1/4"></span>
                <a href="#" class="text-xs text-gray-500 uppercase">or sign up</a>
                <span class="border-b w-1/5 md:w-1/4"></span>
            </div>
        </div>
    </div>
</div>

How to build a Login and registration with image with Tailwind CSS?

Install tailwind css of verion 1.2.0

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

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

All the unility class needed to build a Login and registration with image component

  • py-6
  • flex
  • bg-white
  • overflow-hidden
  • mx-auto
  • max-w-sm
  • lg:max-w-4xl
  • hidden
  • lg:block
  • lg:w-1/2
  • bg-cover
  • w-full
  • p-8
  • text-2xl
  • text-gray-700
  • text-center
  • text-xl
  • text-gray-600
  • mt-4
  • text-white
  • hover:bg-gray-100
  • px-4
  • py-3
  • h-6
  • w-6
  • w-5/6
  • border-b
  • w-1/5
  • lg:w-1/4
  • text-xs
  • text-gray-500
  • block
  • text-sm
  • mb-2
  • bg-gray-200
  • border-gray-300
  • py-2
  • mt-8
  • bg-gray-700
  • hover:bg-gray-600
  • md:w-1/4

41 steps to build a Login and registration with image component with Tailwind CSS

  1. Control the vertical padding of an element to 1.5rem using the py-6 utilities.

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

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

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

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

  6. Set the maximum width/height of an element using the max-w-sm utilities.

  7. Set the maximum width/height of an element using the lg:max-w-4xl utilities at only large screen sizes.

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

  9. Use inline utilities to put the element on its own line and fill its parent at only large screen sizes.

  10. Use lg:w-1/2 to set an element to a fixed width(1/2) at only large screen sizes.

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

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

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

  14. Control the text color of an element to 2xl using the text-2xl 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 center using the text-center utilities.

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

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

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

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

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

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

  23. Control the vertical padding of an element to 0.75rem using the py-3 utilities.

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

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

  26. Use w-5/6 to set an element to a fixed width(5/6).

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

  28. Use w-1/5 to set an element to a fixed width(1/5).

  29. Use lg:w-1/4 to set an element to a fixed width(1/4) at only large screen sizes.

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

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

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

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

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

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

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

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

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

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

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

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

Conclusion

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