Blocks

Stats 8

standard
3 ColumnsText Align LeftText OnlyStats Section
Stats 8

Code

relume-stats8.tsx
type StatsProps = {
  percentage: string;
  heading: string;
};

type Props = {
  heading: string;
  stats: StatsProps[];
};

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

export const Stats8 = (props: Stats8Props) => {
  const { heading, stats } = {
    ...Stats8Defaults,
    ...props,
  };
  return (
    <section className="px-[5%] py-16 md:py-24 lg:py-28">
      <div className="container flex flex-col items-start">
        <div className="mb-12 w-full max-w-lg md:mb-18 lg:mb-20">
          <h3 className="text-h3 font-bold">{heading}</h3>
        </div>
        <div className="grid w-full grid-cols-1 items-start justify-start gap-y-8 md:grid-cols-3 md:gap-x-8 lg:gap-x-12 lg:gap-y-16">
          {stats.map((stat, index) => (
            <div key={index} className="w-full border-l border-scheme-border pl-8">
              <p className="mb-2 text-[3.5rem] leading-[1.3] font-bold md:text-[4rem] lg:text-[5rem]">
                {stat.percentage}
              </p>
              <h3 className="text-h6 font-bold">{stat.heading}</h3>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
};

export const Stats8Defaults: Props = {
  heading: "Long heading is what you see here in this feature section",
  stats: [
    { percentage: "30%", heading: "Short heading goes here" },
    { percentage: "30%", heading: "Short heading goes here" },
    { percentage: "30%", heading: "Short heading goes here" },
  ],
};

npm i @radix-ui/react-accordion @radix-ui/react-dialog @radix-ui/react-slot @radix-ui/react-tabs class-variance-authority@0.7.1 clsx@^2.1.1 motion@^12.15.0 relume-icons@1.3.0 tailwind-merge@^2.2.2