Published on

Here Are 6 Ways To Make A Pricing Section With Tailwind CSS

Pricing section

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 Pricing section ui component

Pricing section from merakiui.com/components

Why use Tailwind CSS to make a Pricing section ui component?

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

The preview of Pricing section ui component

Free download of the Pricing section's source code

The source code of Pricing section ui component

<div class="bg-white dark:bg-gray-900">
            <div class="container px-6 py-8 mx-auto">
                <div class="xl:items-center xl:-mx-8 xl:flex">
                    <div class="flex flex-col items-center xl:items-start xl:mx-8">
                        <h1 class="text-3xl font-medium text-gray-800 capitalize lg:text-4xl dark:text-white">Our Pricing Plan</h1>

                        <div class="mt-4">
                            <span class="inline-block w-40 h-1 bg-blue-500 rounded-full"></span>
                            <span class="inline-block w-3 h-1 mx-1 bg-blue-500 rounded-full"></span>
                            <span class="inline-block w-1 h-1 bg-blue-500 rounded-full"></span>
                        </div>

                        <p class="mt-4 font-medium text-gray-500 dark:text-gray-300">
                            You can get All Access by selecting your plan!
                        </p>

                        <a href="#" class="flex items-center mt-4 -mx-1 text-sm text-gray-700 capitalize dark:text-blue-400 hover:underline hover:text-blue-600 dark:hover:text-blue-500">
                            <span class="mx-1">read more</span>
                            <svg class="w-4 h-4 mx-1" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M12.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-2.293-2.293a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg>
                        </a>
                    </div>

                    <div class="flex-1 xl:mx-8">
                        <div class="mt-8 space-y-8 md:-mx-4 md:flex md:items-center md:justify-center md:space-y-0 xl:mt-0">
                            <div class="max-w-sm mx-auto border rounded-lg md:mx-4 dark:border-gray-700">
                                <div class="p-6">
                                    <h1 class="text-xl font-medium text-gray-700 capitalize lg:text-3xl dark:text-white">Essential</h1>

                                    <p class="mt-4 text-gray-500 dark:text-gray-300">
                                        Lorem ipsum dolor sit amet consectetur, adipisicing elit. Nostrum quam voluptatibus
                                    </p>

                                    <h2 class="mt-4 text-2xl font-medium text-gray-700 sm:text-4xl dark:text-gray-300">$3.00 <span class="text-base font-medium">/Month</span></h2>

                                    <p class="mt-1 text-gray-500 dark:text-gray-300">
                                        Yearly payment
                                    </p>

                                    <button class="w-full px-4 py-2 mt-6 tracking-wide text-white capitalize transition-colors duration-200 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:bg-blue-500 focus:ring focus:ring-blue-300 focus:ring-opacity-80">
                                        Start Now
                                    </button>
                                </div>

                                <hr class="border-gray-200 dark:border-gray-700">

                                <div class="p-6">
                                    <h1 class="text-lg font-medium text-gray-700 capitalize lg:text-xl dark:text-white">What’s included:</h1>

                                    <div class="mt-8 space-y-4">
                                        <div class="flex items-center">
                                            <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-blue-500" viewBox="0 0 20 20" fill="currentColor">
                                                <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
                                            </svg>

                                            <span class="mx-4 text-gray-700 dark:text-gray-300">All limited links</span>
                                        </div>

                                        <div class="flex items-center">
                                            <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-blue-500" viewBox="0 0 20 20" fill="currentColor">
                                                <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
                                            </svg>

                                            <span class="mx-4 text-gray-700 dark:text-gray-300">Own analytics platform</span>
                                        </div>

                                        <div class="flex items-center">
                                            <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-blue-500" viewBox="0 0 20 20" fill="currentColor">
                                                <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
                                            </svg>

                                            <span class="mx-4 text-gray-700 dark:text-gray-300">Chat support</span>
                                        </div>

                                        <div class="flex items-center">
                                            <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-blue-500" viewBox="0 0 20 20" fill="currentColor">
                                                <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
                                            </svg>

                                            <span class="mx-4 text-gray-700 dark:text-gray-300">Optimize hashtags</span>
                                        </div>

                                        <div class="flex items-center">
                                            <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-red-400" viewBox="0 0 20 20" fill="currentColor">
                                                <path fill-rule="evenodd" d="M13.477 14.89A6 6 0 015.11 6.524l8.367 8.368zm1.414-1.414L6.524 5.11a6 6 0 018.367 8.367zM18 10a8 8 0 11-16 0 8 8 0 0116 0z" clip-rule="evenodd" />
                                            </svg>

                                            <span class="mx-4 text-gray-700 dark:text-gray-300">Mobile app</span>
                                        </div>

                                        <div class="flex items-center">
                                            <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-red-400" viewBox="0 0 20 20" fill="currentColor">
                                                <path fill-rule="evenodd" d="M13.477 14.89A6 6 0 015.11 6.524l8.367 8.368zm1.414-1.414L6.524 5.11a6 6 0 018.367 8.367zM18 10a8 8 0 11-16 0 8 8 0 0116 0z" clip-rule="evenodd" />
                                            </svg>

                                            <span class="mx-4 text-gray-700 dark:text-gray-300">Unlimited users</span>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="max-w-sm mx-auto border rounded-lg md:mx-4 dark:border-gray-700">
                                <div class="p-6">
                                    <h1 class="text-xl font-medium text-gray-700 capitalize lg:text-3xl dark:text-white">Premium</h1>

                                    <p class="mt-4 text-gray-500 dark:text-gray-300">
                                        Lorem ipsum dolor sit amet consectetur, adipisicing elit. Nostrum quam voluptatibus
                                    </p>

                                    <h2 class="mt-4 text-2xl font-medium text-gray-700 sm:text-4xl dark:text-gray-300">$50.00 <span class="text-base font-medium">/life time</span></h2>

                                    <p class="mt-1 text-gray-500 dark:text-gray-300">
                                        One time payment
                                    </p>

                                    <button class="w-full px-4 py-2 mt-6 tracking-wide text-white capitalize transition-colors duration-200 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:bg-blue-500 focus:ring focus:ring-blue-300 focus:ring-opacity-80">
                                        Start Now
                                    </button>
                                </div>

                                <hr class="border-gray-200 dark:border-gray-700">

                                <div class="p-6">
                                    <h1 class="text-lg font-medium text-gray-700 capitalize lg:text-xl dark:text-white">What’s included:</h1>

                                    <div class="mt-8 space-y-4">
                                        <div class="flex items-center">
                                            <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-blue-500" viewBox="0 0 20 20" fill="currentColor">
                                                <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
                                            </svg>

                                            <span class="mx-4 text-gray-700 dark:text-gray-300">All limited links</span>
                                        </div>

                                        <div class="flex items-center">
                                            <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-blue-500" viewBox="0 0 20 20" fill="currentColor">
                                                <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
                                            </svg>

                                            <span class="mx-4 text-gray-700 dark:text-gray-300">Own analytics platform</span>
                                        </div>

                                        <div class="flex items-center">
                                            <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-blue-500" viewBox="0 0 20 20" fill="currentColor">
                                                <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
                                            </svg>

                                            <span class="mx-4 text-gray-700 dark:text-gray-300">Chat support</span>
                                        </div>

                                        <div class="flex items-center">
                                            <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-blue-500" viewBox="0 0 20 20" fill="currentColor">
                                                <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
                                            </svg>

                                            <span class="mx-4 text-gray-700 dark:text-gray-300">Optimize hashtags</span>
                                        </div>

                                        <div class="flex items-center">
                                            <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-blue-500" viewBox="0 0 20 20" fill="currentColor">
                                                <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
                                            </svg>

                                            <span class="mx-4 text-gray-700 dark:text-gray-300">Mobile app</span>
                                        </div>

                                        <div class="flex items-center">
                                            <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-blue-500" viewBox="0 0 20 20" fill="currentColor">
                                                <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
                                            </svg>

                                            <span class="mx-4 text-gray-700 dark:text-gray-300">Unlimited users</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

How to make a Pricing section with Tailwind CSS?

Install tailwind css of verion 3.0.18

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

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

All the unility class needed to make a Pricing section component

  • bg-white
  • dark:bg-gray-900
  • px-6
  • py-8
  • mx-auto
  • xl:-mx-8
  • xl:flex
  • flex
  • flex-col
  • xl:mx-8
  • text-3xl
  • text-gray-800
  • lg:text-4xl
  • dark:text-white
  • mt-4
  • inline-block
  • w-40
  • h-1
  • bg-blue-500
  • w-3
  • mx-1
  • w-1
  • text-gray-500
  • dark:text-gray-300
  • -mx-1
  • text-sm
  • text-gray-700
  • dark:text-blue-400
  • hover:text-blue-600
  • w-4
  • h-4
  • flex-1
  • mt-8
  • md:-mx-4
  • md:flex
  • xl:mt-0
  • max-w-sm
  • md:mx-4
  • dark:border-gray-700
  • p-6
  • text-xl
  • lg:text-3xl
  • text-2xl
  • sm:text-4xl
  • text-base
  • mt-1
  • w-full
  • px-4
  • py-2
  • mt-6
  • text-white
  • bg-blue-600
  • hover:bg-blue-500
  • focus:bg-blue-500
  • border-gray-200
  • text-lg
  • lg:text-xl
  • w-5
  • h-5
  • text-blue-500
  • mx-4
  • text-red-400

62 steps to make a Pricing section 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-900 using the dark:bg-gray-900 utilities in dark theme.

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

  4. Control the vertical padding of an element to 2rem using the py-8 utilities.

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

  6. Control the horizontal margin of an element to -2rem at only extremely large screen sizes using the xl:-mx-8 utilities.

  7. Use flex to create a block-level flex container at only extremely large screen sizes.

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

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

  10. Control the horizontal margin of an element to 2rem at only extremely large screen sizes using the xl:mx-8 utilities.

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

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

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

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

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

  16. Use inline-block utilities to wrap the element to prevent the text inside from extending beyond its parent.

  17. Use w-40 to set an element to a fixed width(10rem).

  18. Use h-1 to set an element to a fixed height(0.25rem).

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

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

  21. Control the horizontal margin of an element to 0.25rem using the mx-1 utilities.

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

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

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

  25. Control the horizontal margin of an element to -0.25rem using the -mx-1 utilities.

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

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

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

  29. Control the text color of an element to blue-600 on hover using the hover:text-blue-600 utilities.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  44. Control the text color of an element to 4xl at only small screen sizes using the sm:text-4xl utilities.

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

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

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

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

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

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

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

  52. Control the background color of an element to blue-600 using the bg-blue-600 utilities.

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

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

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

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

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

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

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

  60. Control the text color of an element to blue-500 using the text-blue-500 utilities.

  61. Control the horizontal margin of an element to 1rem using the mx-4 utilities.

  62. Control the text color of an element to red-400 using the text-red-400 utilities.

Conclusion

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