Blocks

Pricing 45

Pricing
4 ColumnsText Align LeftPricing Section
Pricing 45

Code

relume-pricing45.tsx
"use client";

import { Check, RelumeIcon } from "relume-icons";

import { Button, type ButtonProps } from "@/components/ui/button";
import { Card } from "@/components/ui/card";

type PricingPlan = {
  planName: string;
  monthlyPrice: string;
  yearlyPrice: string;
  features: string[];
  button: ButtonProps;
};

type Props = {
  tagline: string;
  heading: string;
  description: string;
  pricingPlans: PricingPlan[];
};

export type Pricing45Props = React.ComponentPropsWithoutRef<"section"> & Partial<Props>;

export const Pricing45 = (props: Pricing45Props) => {
  const { tagline, heading, description, pricingPlans } = {
    ...Pricing45Defaults,
    ...props,
  };
  return (
    <section className="px-[5%] py-16 md:py-24 lg:py-28">
      <div className="container">
        <div className="b-12 max-w-lg md:mb-18 lg:mb-20">
          <p className="mb-3 font-semibold md:mb-4">{tagline}</p>
          <h2 className="mb-5 text-h2 font-bold md:mb-6">{heading}</h2>
          <p className="text-medium">{description}</p>
        </div>
        <div className="grid grid-cols-1 gap-6 lg:grid-cols-4">
          {pricingPlans.map((plan, index) => (
            <Card key={index} className="flex h-full flex-col justify-between p-6">
              <div>
                <div className="mb-2 flex items-start justify-between">
                  <h6 className="text-h6 font-bold">{plan.planName}</h6>
                  <RelumeIcon className="size-8 text-scheme-text" />
                </div>
                <h3 className="mb-2 text-h2 font-bold">
                  {plan.monthlyPrice}
                  <h4 className="inline text-h5 font-bold">/mo</h4>
                </h3>
                <p>or {plan.yearlyPrice} yearly</p>
                <div className="my-6 h-px w-full shrink-0 bg-scheme-border md:my-8" />
                <p>Includes:</p>
                <div className="mt-3 grid grid-cols-1 gap-y-4 py-2 md:mt-4">
                  {plan.features.map((feature, index) => (
                    <div key={index} className="flex self-start">
                      <div className="mr-4 flex-none self-start">
                        <Check className="size-6 text-scheme-text" />
                      </div>
                      <p>{feature}</p>
                    </div>
                  ))}
                </div>
              </div>
              <div>
                <Button {...plan.button} className="mt-6 w-full md:mt-8">
                  {plan.button.title}
                </Button>
              </div>
            </Card>
          ))}
        </div>
      </div>
    </section>
  );
};

export const Pricing45Defaults: Props = {
  tagline: "Tagline",
  heading: "Pricing plan",
  description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
  pricingPlans: [
    {
      planName: "Free plan",
      monthlyPrice: "$0",
      yearlyPrice: "$0",
      features: ["Feature text goes here", "Feature text goes here", "Feature text goes here"],
      button: { title: "Get started" },
    },
    {
      planName: "Basic plan",
      monthlyPrice: "$19",
      yearlyPrice: "$199",
      features: ["Feature text goes here", "Feature text goes here", "Feature text goes here"],
      button: { title: "Get started" },
    },
    {
      planName: "Business plan",
      monthlyPrice: "$29",
      yearlyPrice: "$299",
      features: [
        "Feature text goes here",
        "Feature text goes here",
        "Feature text goes here",
        "Feature text goes here",
      ],
      button: { title: "Get started" },
    },
    {
      planName: "Enterprise plan",
      monthlyPrice: "$49",
      yearlyPrice: "$499",
      features: [
        "Feature text goes here",
        "Feature text goes here",
        "Feature text goes here",
        "Feature text goes here",
        "Feature text goes here",
      ],
      button: { title: "Get started" },
    },
  ],
};

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