Pricing 50
Pricing2 ColumnsText Align CenterPricing SectionPricing Comparison Section

Code
relume-pricing50.tsx
import clsx from "clsx";
import { Button, type ButtonProps } from "@/components/ui/button";
import { Check } from "relume-icons";
type Feature = {
text: string;
items: React.ReactNode[];
};
type FeatureCategory = {
title?: string;
features: Feature[];
};
type PricingPlan = {
planName: string;
monthlyPrice: string;
description: string;
button: ButtonProps;
};
type Props = {
tagline: string;
heading: string;
description: string;
pricingPlans: PricingPlan[];
featureCategories: FeatureCategory[];
};
export type Pricing50Props = React.ComponentPropsWithoutRef<"section"> & Partial<Props>;
export const Pricing50 = (props: Pricing50Props) => {
const { tagline, heading, description, pricingPlans, featureCategories } = {
...Pricing50Defaults,
...props,
};
return (
<section className="px-[5%] py-16 md:py-24 lg:py-28">
<div className="container">
<div className="mx-auto mb-12 max-w-lg text-center md:mb-18 lg:mb-20">
<p className="mb-3 font-semibold md:mb-4">{tagline}</p>
<h1 className="mb-5 text-h2 font-bold md:mb-6">{heading}</h1>
<p className="text-medium">{description}</p>
</div>
<div className="w-full">
<div className="sticky top-0 grid grid-cols-2 border-b border-scheme-border bg-scheme-background md:grid-cols-[1.5fr_1fr_1fr]">
<div className="hidden md:block" />
{pricingPlans.map((plan, index) => (
<PricingPlan key={index} {...plan} index={index} />
))}
</div>
<FeaturesSection featureCategories={featureCategories} />
</div>
</div>
</section>
);
};
const PricingPlan = ({
planName,
monthlyPrice,
description,
button,
index,
}: PricingPlan & { index: number }) => {
return (
<div
className={clsx(
"flex h-full flex-col justify-between border-scheme-border px-2 py-4 sm:px-4 sm:py-6 lg:px-6 lg:py-8",
{
"border-0 md:border-l": index === 0,
"border-l": index > 0,
},
)}
>
<div>
<h2 className="text-h6 font-bold">{planName}</h2>
<div className="my-3 md:my-4">
<h1 className="text-h1 font-bold">{monthlyPrice}</h1>
<p className="font-bold">Per month</p>
</div>
<p>{description}</p>
</div>
<div className="mt-6 md:mt-8">
<Button {...button} className="w-full whitespace-normal">
{button.title}
</Button>
</div>
</div>
);
};
const FeaturesSection = ({ featureCategories }: { featureCategories: FeatureCategory[] }) => {
return (
<div>
{featureCategories.map((featureCategory, index) => (
<div key={index}>
{featureCategory.title && (
<div className="border-b border-scheme-border py-5">
<h3 className="text-h6 font-bold">{featureCategory.title}</h3>
</div>
)}
{featureCategory.features.map((feature, index) => (
<div
key={index}
className="grid grid-cols-2 border-b border-scheme-border md:grid-cols-[1.5fr_1fr_1fr]"
>
<p className="col-span-2 row-span-1 border-b border-scheme-border py-4 pr-4 md:col-span-1 md:border-0 md:pr-6">
{feature.text}
</p>
{feature.items.map((item, index) => (
<div
key={index}
className={clsx(
"flex items-center justify-center border-scheme-border px-4 py-4 text-center font-semibold md:px-6",
{
"border-0 md:border-l": index === 0,
"border-l": index > 0,
},
)}
>
<p>{item}</p>
</div>
))}
</div>
))}
</div>
))}
</div>
);
};
export const Pricing50Defaults: Props = {
tagline: "Tagline",
heading: "Pricing plan",
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
pricingPlans: [
{
planName: "Basic",
monthlyPrice: "$19",
description: "Lorem ipsum dolor sit amet",
button: {
title: "Get started",
},
},
{
planName: "Business",
monthlyPrice: "$29",
description: "Lorem ipsum dolor sit amet",
button: {
title: "Get started",
},
},
],
featureCategories: [
{
title: "Feature Category",
features: [
{
text: "Feature text goes here",
items: ["10", "25"],
},
{
text: "Feature text goes here",
items: [
<Check className="size-6 text-scheme-text" />,
<Check className="size-6 text-scheme-text" />,
],
},
{
text: "Feature text goes here",
items: [
<Check className="size-6 text-scheme-text" />,
<Check className="size-6 text-scheme-text" />,
],
},
{
text: "Feature text goes here",
items: ["", <Check className="size-6 text-scheme-text" />],
},
],
},
{
title: "Feature Category",
features: [
{
text: "Feature text goes here",
items: ["10", "25"],
},
{
text: "Feature text goes here",
items: [
<Check className="size-6 text-scheme-text" />,
<Check className="size-6 text-scheme-text" />,
],
},
{
text: "Feature text goes here",
items: [
<Check className="size-6 text-scheme-text" />,
<Check className="size-6 text-scheme-text" />,
],
},
{
text: "Feature text goes here",
items: ["", <Check className="size-6 text-scheme-text" />],
},
],
},
{
title: "Feature Category",
features: [
{
text: "Feature text goes here",
items: ["10", "25"],
},
{
text: "Feature text goes here",
items: [
<Check className="size-6 text-scheme-text" />,
<Check className="size-6 text-scheme-text" />,
],
},
{
text: "Feature text goes here",
items: [
<Check className="size-6 text-scheme-text" />,
<Check className="size-6 text-scheme-text" />,
],
},
{
text: "Feature text goes here",
items: ["", <Check className="size-6 text-scheme-text" />],
},
],
},
],
};npm i @radix-ui/react-accordion @radix-ui/react-dialog @radix-ui/react-slot class-variance-authority@0.7.1 clsx@^2.1.1 motion@^12.15.0 relume-icons@1.3.0 tailwind-merge@^2.2.2


