Published on

How to Make A Stripe Pricing With Tailwind CSS?

Tags
Stripe Pricing

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

A reproduction of stripe's pricing page

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

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

The preview of Stripe Pricing ui component

Free download of the Stripe Pricing's source code

The source code of Stripe Pricing ui component

<section class="font-sans antialiased w-full bg-green py-8">
	<div class="container mx-auto">
		<div class="py-8 w-full mx-auto">
			<h1 class="text-indigo-darkest text-4xl text-center font-normal">Simple, transparent pricing.</h1>
			<h2 class="text-white text-4xl text-center font-normal">Always know what you'll pay</h2>
			<div class="my-8 flex flex-wrap md:items-center w-full">
				<div class="bg-white shadow rounded w-full md:w-1/2 z-10">
					<div class="py-8 text-center text-green font-semibold uppercase">Pay as you go</div>
					<hr class="py-0 my-0 border border-grey-lighter">
					<div class="py-8">
						<div class="flex items-top">
							<div class="w-1/2 flex justify-center items-center"><span class="text-3xl font-semibold text-indigo-darker">1.4%</span>
								<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" class="icon fill-current text-grey mx-2 h-6 w-6">
									<path d="M17 11a1 1 0 0 1 0 2h-4v4a1 1 0 0 1-2 0v-4H7a1 1 0 0 1 0-2h4V7a1 1 0 0 1 2 0v4h4z" class="heroicon-ui"></path>
								</svg> <span class="text-xl font-semibold text-indigo-darker">&euro;0.25</span>
							</div>
							<div class="w-1/2 flex justify-center items-center"><span class="text-3xl font-semibold text-indigo-darker">2.9%</span>
								<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" class="icon fill-current text-grey mx-2 h-6 w-6">
									<path d="M17 11a1 1 0 0 1 0 2h-4v4a1 1 0 0 1-2 0v-4H7a1 1 0 0 1 0-2h4V7a1 1 0 0 1 2 0v4h4z" class="heroicon-ui"></path>
								</svg> <span class="text-xl font-semibold text-indigo-darker">&euro;0.25</span>
							</div>
						</div>
						<div class="flex items-top mt-4">
							<div class="w-1/2 text-center text-xs text-grey-dark">for European cards.</div>
							<div class="w-1/2 text-center text-xs text-grey-dark">for non-European cards.</div>
						</div>
						<div class="mt-8 mx-auto w-2/3">
							<div class="flex items-center mb-4"><span class="inline-flex bg-green-lighter rounded-full mr-4 p-1"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" class="icon fill-current text-green h-4 w-4"><path d="M6.1 21.98a1 1 0 0 1-1.45-1.06l1.03-6.03-4.38-4.26a1 1 0 0 1 .56-1.71l6.05-.88 2.7-5.48a1 1 0 0 1 1.8 0l2.7 5.48 6.06.88a1 1 0 0 1 .55 1.7l-4.38 4.27 1.04 6.03a1 1 0 0 1-1.46 1.06l-5.4-2.85-5.42 2.85zm4.95-4.87a1 1 0 0 1 .93 0l4.08 2.15-.78-4.55a1 1 0 0 1 .29-.88l3.3-3.22-4.56-.67a1 1 0 0 1-.76-.54l-2.04-4.14L9.47 9.4a1 1 0 0 1-.75.54l-4.57.67 3.3 3.22a1 1 0 0 1 .3.88l-.79 4.55 4.09-2.15z" class="heroicon-ui"></path></svg></span>  <span class="text-grey-darker">No setup, monthly, or hidden fees</span>
							</div>
							<div class="flex items-center mb-4"><span class="inline-flex bg-green-lighter rounded-full mr-4 p-1"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" class="icon fill-current text-green h-4 w-4"><path d="M11 18.59V3a1 1 0 0 1 2 0v15.59l5.3-5.3a1 1 0 0 1 1.4 1.42l-7 7a1 1 0 0 1-1.4 0l-7-7a1 1 0 0 1 1.4-1.42l5.3 5.3z" class="heroicon-ui"></path></svg></span>  <span class="text-grey-darker">Pay only for what you use</span>
							</div>
							<div class="flex items-center mb-4"><span class="inline-flex bg-green-lighter rounded-full mr-4 p-1"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" class="icon fill-current text-green h-4 w-4"><path d="M20 22H4a2 2 0 0 1-2-2v-8c0-1.1.9-2 2-2h4V8c0-1.1.9-2 2-2h4V4c0-1.1.9-2 2-2h4a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2zM14 8h-4v12h4V8zm-6 4H4v8h4v-8zm8-8v16h4V4h-4z" class="heroicon-ui"></path></svg></span>  <span class="text-grey-darker">Real-time fee reporting</span>
							</div>
						</div>
					</div>
					<a href="#">
						<div class="py-8 bg-grey-lighter hover:bg-grey-light text-indigo-darker rounded rounded-t-none text-center uppercase font-bold flex items-center justify-center"><span>Create account</span>
							<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" class="icon fill-current w-4 h-4 ml-2">
								<path d="M18.59 13H3a1 1 0 0 1 0-2h15.59l-5.3-5.3a1 1 0 1 1 1.42-1.4l7 7a1 1 0 0 1 0 1.4l-7 7a1 1 0 0 1-1.42-1.4l5.3-5.3z" class="heroicon-ui"></path>
							</svg>
						</div>
					</a>
				</div>
				<div class="bg-indigo-darker rounded shadow w-5/6 md:w-1/2 z-0 mx-auto -mt-1 md:-mt-0 md:-ml-1">
					<div class="py-8 text-center text-indigo-lightest font-semibold uppercase">Enterprise</div>
					<hr class="mb-8 my-0 border border-indigo-dark opacity-25">
					<div class="w-2/3 mx-auto">
						<p class="text-center text-sm text-indigo-lightest opacity-75 leading-normal">Stripe offers everything needed to run an online business at scale. Get in touch for details.</p>
					</div>
					<div class="py-8">
						<table class="w-3/4 mx-auto text-indigo-lightest text-center" style="border-collapse: collapse;">
							<tbody>
								<tr>
									<td class="px-2 py-4 border border-indigo-dark">Account management</td>
									<td class="px-2 py-4 border border-indigo-dark">Volume discounts</td>
								</tr>
								<tr>
									<td class="px-2 py-4 border border-indigo-dark">Migration assistance</td>
									<td class="px-2 py-4 border border-indigo-dark">Dedicated support</td>
								</tr>
							</tbody>
						</table>
					</div>
					<a href="#">
						<div class="py-8 opacity-50 bg-indigo-darkest hover:bg-indigo-dark text-indigo-lighter rounded rounded-t-none text-center uppercase font-bold flex items-center justify-center"><span>Contact sales</span>
							<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" class="icon fill-current w-4 h-4 ml-2">
								<path d="M18.59 13H3a1 1 0 0 1 0-2h15.59l-5.3-5.3a1 1 0 1 1 1.42-1.4l7 7a1 1 0 0 1 0 1.4l-7 7a1 1 0 0 1-1.42-1.4l5.3-5.3z" class="heroicon-ui"></path>
							</svg>
						</div>
					</a>
				</div>
			</div>
		</div>
	</div>
</section>

How to make a Stripe Pricing with Tailwind CSS?

Install tailwind css of verion 0.3.0

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

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

All the unility class needed to make a Stripe Pricing component

  • w-full
  • bg-green
  • py-8
  • mx-auto
  • text-indigo-darkest
  • text-4xl
  • text-center
  • text-white
  • my-8
  • flex
  • flex-wrap
  • bg-white
  • md:w-1/2
  • z-10
  • text-green
  • py-0
  • my-0
  • border-grey-lighter
  • w-1/2
  • text-3xl
  • text-indigo-darker
  • text-grey
  • mx-2
  • h-6
  • w-6
  • text-xl
  • mt-4
  • text-xs
  • text-grey-dark
  • mt-8
  • w-2/3
  • mb-4
  • inline-flex
  • bg-green-lighter
  • mr-4
  • p-1
  • h-4
  • w-4
  • text-grey-darker
  • bg-grey-lighter
  • hover:bg-grey-light
  • ml-2
  • bg-indigo-darker
  • w-5/6
  • z-0
  • -mt-1
  • md:-mt-0
  • md:-ml-1
  • text-indigo-lightest
  • mb-8
  • border-indigo-dark
  • text-sm
  • w-3/4
  • px-2
  • py-4
  • bg-indigo-darkest
  • hover:bg-indigo-dark
  • text-indigo-lighter

58 steps to make a Stripe Pricing component with Tailwind CSS

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

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

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

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

  5. Control the text color of an element to indigo-darkest using the text-indigo-darkest utilities.

  6. Control the text color of an element to 4xl using the text-4xl 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 white using the text-white utilities.

  9. Control the vertical margin of an element to 2rem using the my-8 utilities.

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

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

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

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

  14. Control the stack order (or three-dimensional positioning) of an element to 10 in Tailwind, regardless of order it has been displayed, using the z-10 utilities.

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

  16. Control the vertical padding of an element to 0rem using the py-0 utilities.

  17. Control the vertical margin of an element to 0rem using the my-0 utilities.

  18. Control the border color of an element to grey-lighter using the border-grey-lighter utilities.

  19. Use w-1/2 to set an element to a fixed width(1/2).

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

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

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

  23. Control the horizontal margin of an element to 0.5rem using the mx-2 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. Control the text color of an element to xl using the text-xl utilities.

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

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

  29. Control the text color of an element to grey-dark using the text-grey-dark utilities.

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

  31. Use w-2/3 to set an element to a fixed width(2/3).

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

  33. Use inline-flex to create an inline flex container that flows with text.

  34. Control the background color of an element to green-lighter using the bg-green-lighter utilities.

  35. Control the margin on right side of an element to 1rem using the mr-4 utilities.

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

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

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

  39. Control the text color of an element to grey-darker using the text-grey-darker utilities.

  40. Control the background color of an element to grey-lighter using the bg-grey-lighter utilities.

  41. Control the background color of an element to grey-light using the hover:bg-grey-light utilities on hover.

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

  43. Control the background color of an element to indigo-darker using the bg-indigo-darker utilities.

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

  45. Control the stack order (or three-dimensional positioning) of an element to 0 in Tailwind, regardless of order it has been displayed, using the z-0 utilities.

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

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

  48. Control the margin on left side of an element to -0.25rem at only medium screen sizes using the md:-ml-1 utilities.

  49. Control the text color of an element to indigo-lightest using the text-indigo-lightest utilities.

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

  51. Control the border color of an element to indigo-dark using the border-indigo-dark utilities.

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

  53. Use w-3/4 to set an element to a fixed width(3/4).

  54. Control the horizontal padding of an element to 0.5rem using the px-2 utilities.

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

  56. Control the background color of an element to indigo-darkest using the bg-indigo-darkest utilities.

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

  58. Control the text color of an element to indigo-lighter using the text-indigo-lighter utilities.

Conclusion

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