Published on

6 Easy Ways To Make A Hero With Slide With Tailwind CSS Without Even Thinking About It

Hero With slide

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 Hero With slide ui component

Hero with slide from meraki ui components merakiui.com

Why use Tailwind CSS to create a Hero With slide ui component?

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

The preview of Hero With slide ui component

Free download of the Hero With slide's source code

The source code of Hero With slide ui component

<header class="bg-white dark:bg-gray-800">
    <nav class="bg-white dark:bg-gray-800">
        <div class="container p-6 mx-auto">
            <a class="block text-2xl font-bold text-center text-gray-800 dark:text-white lg:text-3xl hover:text-gray-700 dark:hover:text-gray-300" href="#">Brand</a>

            <div class="flex items-center justify-center mt-6 text-gray-600 capitalize dark:text-gray-300">
                <a href="#" class="text-gray-800 dark:text-gray-200 border-b-2 border-blue-500 mx-1.5 sm:mx-6">home</a>

                <a href="#" class="border-b-2 border-transparent hover:text-gray-800 dark:hover:text-gray-200 hover:border-blue-500 mx-1.5 sm:mx-6">features</a>

                <a href="#" class="border-b-2 border-transparent hover:text-gray-800 dark:hover:text-gray-200 hover:border-blue-500 mx-1.5 sm:mx-6">pricing</a>

                <a href="#" class="border-b-2 border-transparent hover:text-gray-800 dark:hover:text-gray-200 hover:border-blue-500 mx-1.5 sm:mx-6">blog</a>

                <a href="#" class="border-b-2 border-transparent hover:text-gray-800 dark:hover:text-gray-200 hover:border-blue-500 mx-1.5 sm:mx-6">
                    <svg class="w-4 h-4 fill-current" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M1 11.9554V12.0446C1.01066 14.7301 1.98363 17.1885 3.59196 19.0931C4.05715 19.6439 4.57549 20.1485 5.13908 20.5987C5.70631 21.0519 6.31937 21.4501 6.97019 21.7853C7.90271 22.2656 8.91275 22.6165 9.97659 22.8143C10.5914 22.9286 11.2243 22.9918 11.8705 22.9993C11.9136 22.9998 11.9567 23 11.9999 23C15.6894 23 18.9547 21.1836 20.9502 18.3962C21.3681 17.8125 21.7303 17.1861 22.0291 16.525C22.6528 15.1448 22.9999 13.613 22.9999 12C22.9999 8.73978 21.5816 5.81084 19.3283 3.79653C18.8064 3.32998 18.2397 2.91249 17.6355 2.55132C15.9873 1.56615 14.0597 1 11.9999 1C11.888 1 11.7764 1.00167 11.6653 1.00499C9.99846 1.05479 8.42477 1.47541 7.0239 2.18719C6.07085 2.67144 5.19779 3.29045 4.42982 4.01914C3.7166 4.69587 3.09401 5.4672 2.58216 6.31302C2.22108 6.90969 1.91511 7.54343 1.6713 8.20718C1.24184 9.37631 1.00523 10.6386 1 11.9554ZM20.4812 15.0186C20.8171 14.075 20.9999 13.0588 20.9999 12C20.9999 9.54265 20.0151 7.31533 18.4186 5.6912C17.5975 7.05399 16.5148 8.18424 15.2668 9.0469C15.7351 10.2626 15.9886 11.5603 16.0045 12.8778C16.7692 13.0484 17.5274 13.304 18.2669 13.6488C19.0741 14.0252 19.8141 14.487 20.4812 15.0186ZM15.8413 14.8954C16.3752 15.0321 16.904 15.22 17.4217 15.4614C18.222 15.8346 18.9417 16.3105 19.5723 16.8661C18.0688 19.2008 15.5151 20.7953 12.5788 20.9817C13.5517 20.0585 14.3709 18.9405 14.972 17.6514C15.3909 16.7531 15.678 15.8272 15.8413 14.8954ZM13.9964 12.6219C13.9583 11.7382 13.7898 10.8684 13.5013 10.0408C10.6887 11.2998 7.36584 11.3765 4.35382 9.97197C4.01251 9.81281 3.68319 9.63837 3.36632 9.44983C3.12787 10.2584 2.99991 11.1142 2.99991 12C2.99991 13.9462 3.61763 15.748 4.6677 17.2203C6.83038 14.1875 10.3685 12.4987 13.9964 12.6219ZM6.047 18.7502C7.77258 16.059 10.7714 14.5382 13.8585 14.6191C13.723 15.3586 13.4919 16.093 13.1594 16.8062C12.3777 18.4825 11.1453 19.805 9.67385 20.6965C8.31043 20.3328 7.07441 19.6569 6.047 18.7502ZM11.9999 3C13.7846 3 15.4479 3.51946 16.847 4.41543C16.2113 5.54838 15.3593 6.4961 14.368 7.23057C13.3472 5.57072 11.8752 4.16433 10.027 3.21692C10.6619 3.07492 11.3222 3 11.9999 3ZM8.80619 4.84582C10.4462 5.61056 11.7474 6.80659 12.6379 8.23588C10.3464 9.24654 7.64722 9.30095 5.19906 8.15936C4.83384 7.98905 4.48541 7.79735 4.15458 7.58645C4.91365 6.24006 6.00929 5.10867 7.32734 4.30645C7.82672 4.44058 8.32138 4.61975 8.80619 4.84582Z" fill="currentColor" /></svg>
                </a>

                <a href="#" class="border-b-2 border-transparent hover:text-gray-800 dark:hover:text-gray-200 hover:border-blue-500 mx-1.5 sm:mx-6">
                    <svg class="w-5 h-5 fill-current" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m.75 19h7.092c4.552 0 6.131-6.037 2.107-8.203 2.701-2.354 1.029-6.797-2.595-6.797h-6.604c-.414 0-.75.336-.75.75v13.5c0 .414.336.75.75.75zm.75-13.5h5.854c3.211 0 3.215 4.768 0 4.768h-5.854zm0 6.268h6.342c3.861 0 3.861 5.732 0 5.732h-6.342z"/><path d="m18.374 7.857c-3.259 0-5.755 2.888-5.635 5.159-.247 3.28 2.397 5.984 5.635 5.984 2.012 0 3.888-1.065 4.895-2.781.503-.857-.791-1.613-1.293-.76-.739 1.259-2.12 2.041-3.602 2.041-2.187 0-3.965-1.668-4.125-3.771 1.443.017 4.136-.188 8.987-.033.016 0 .027-.008.042-.008 2-.09-.189-5.831-4.904-5.831zm-3.928 4.298c1.286-3.789 6.718-3.676 7.89.064-4.064.097-6.496-.066-7.89-.064z"/><path d="m21.308 6.464c.993 0 .992-1.5 0-1.5h-5.87c-.993 0-.992 1.5 0 1.5z"/></svg>
                </a>
            </div>
        </div>
    </nav>

    <div class="container flex flex-col px-6 py-4 mx-auto space-y-6 md:h-128 md:py-16 md:flex-row md:items-center md:space-x-6">
        <div class="flex flex-col items-center w-full md:flex-row md:w-1/2">
            <div class="flex justify-center order-2 mt-6 md:mt-0 md:space-y-3 md:flex-col">
                <button class="w-3 h-3 mx-2 bg-blue-500 rounded-full md:mx-0 focus:outline-none"></button>
                <button class="w-3 h-3 mx-2 bg-gray-300 rounded-full md:mx-0 focus:outline-none hover:bg-blue-500"></button>
                <button class="w-3 h-3 mx-2 bg-gray-300 rounded-full md:mx-0 focus:outline-none hover:bg-blue-500"></button>
                <button class="w-3 h-3 mx-2 bg-gray-300 rounded-full md:mx-0 focus:outline-none hover:bg-blue-500"></button>
            </div>

            <div class="max-w-lg md:mx-12 md:order-2">
                <h1 class="text-3xl font-medium tracking-wide text-gray-800 dark:text-white md:text-4xl">The best Apple Watch apps</h1>
                <p class="mt-4 text-gray-600 dark:text-gray-300">Lorem ipsum, dolor sit amet consectetur adipisicing elit. Aut quia asperiores alias vero magnam recusandae adipisci ad vitae laudantium quod rem voluptatem eos accusantium cumque.</p>
                <div class="mt-6">
                    <a href="#" class="block px-3 py-2 font-semibold text-center text-white transition-colors duration-200 transform bg-blue-500 rounded-md md:inline hover:bg-blue-400">Download from App Store</a>
                </div>
            </div>
        </div>

        <div class="flex items-center justify-center w-full h-96 md:w-1/2">
            <img class="object-cover w-full h-full max-w-2xl rounded-md" src="https://images.unsplash.com/photo-1579586337278-3befd40fd17a?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1352&q=80" alt="apple watch photo">
        </div>
    </div>
</header>

How to create a Hero With slide with Tailwind CSS?

Install tailwind css of verion 2.1.0

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

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

All the unility class needed to create a Hero With slide component

  • bg-white
  • dark:bg-gray-800
  • p-6
  • mx-auto
  • block
  • text-2xl
  • text-center
  • text-gray-800
  • dark:text-white
  • lg:text-3xl
  • hover:text-gray-700
  • flex
  • mt-6
  • text-gray-600
  • dark:text-gray-300
  • dark:text-gray-200
  • border-b-2
  • border-blue-500
  • mx-1.5
  • sm:mx-6
  • border-transparent
  • hover:text-gray-800
  • hover:border-blue-500
  • w-4
  • h-4
  • w-5
  • h-5
  • flex-col
  • px-6
  • py-4
  • md:h-128
  • md:py-16
  • md:flex-row
  • w-full
  • md:w-1/2
  • md:mt-0
  • md:flex-col
  • w-3
  • h-3
  • mx-2
  • bg-blue-500
  • md:mx-0
  • bg-gray-300
  • hover:bg-blue-500
  • max-w-lg
  • md:mx-12
  • text-3xl
  • md:text-4xl
  • mt-4
  • px-3
  • py-2
  • text-white
  • md:inline
  • hover:bg-blue-400
  • h-96
  • h-full
  • max-w-2xl

57 steps to create a Hero With slide component with Tailwind CSS

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

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

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

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

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

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

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

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

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

  10. Control the text color of an element to 3xl at only large screen sizes using the lg:text-3xl utilities.

  11. Control the text color of an element to gray-700 on hover using the hover:text-gray-700 utilities.

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

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

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

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

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

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

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

  19. Control the horizontal margin of an element to 1.5 using the mx-1.5 utilities.

  20. Control the horizontal margin of an element to 1.5rem at only small screen sizes using the sm:mx-6 utilities.

  21. Control the border color of an element to transparent using the border-transparent utilities.

  22. Control the text color of an element to gray-800 on hover using the hover:text-gray-800 utilities.

  23. Control the border color of an element to blue-500 using the hover:border-blue-500 utilities on hover.

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

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

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

  27. Use h-5 to set an element to a fixed height(1.25rem).

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

  29. Control the horizontal padding of an element to 1.5rem using the px-6 utilities.

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

  31. Use md:h-128 to set an element to a fixed height(32rem) at only medium screen sizes.

  32. Control the vertical padding of an element to 4rem at only medium screen sizes using the md:py-16 utilities.

  33. Use flex to create a block-level flex container at only medium screen sizes.

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

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

  36. Control the margin on top side of an element to 0rem at only medium screen sizes using the md:mt-0 utilities.

  37. Use flex to create a block-level flex container at only medium screen sizes.

  38. Use w-3 to set an element to a fixed width(0.75rem).

  39. Use h-3 to set an element to a fixed height(0.75rem).

  40. Control the horizontal margin of an element to 0.5rem using the mx-2 utilities.

  41. Control the background color of an element to blue-500 using the bg-blue-500 utilities.

  42. Control the horizontal margin of an element to 0rem at only medium screen sizes using the md:mx-0 utilities.

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

  44. Control the background color of an element to blue-500 using the hover:bg-blue-500 utilities on hover.

  45. Set the maximum width/height of an element using the max-w-lg utilities.

  46. Control the horizontal margin of an element to 3rem at only medium screen sizes using the md:mx-12 utilities.

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

  48. Control the text color of an element to 4xl at only medium screen sizes using the md:text-4xl utilities.

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

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

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

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

  53. Use inline utilities to control the flow of text inside the element to wrap normally at only medium screen sizes.

  54. Control the background color of an element to blue-400 using the hover:bg-blue-400 utilities on hover.

  55. Use h-96 to set an element to a fixed height(24rem).

  56. Use h-full to set an element’s height to 100% of its parent, as long as the parent has a defined height.

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

Conclusion

The above is a step-by-step tutorial on how to use Tailwind CSS to create a Hero With slide components, learn and follow along to implement your own components.