Skip to content

Stats & values

Stats Chart

A short introduction centered above a chart of percentages whose bars grow into view.

Layout and motion from the Nitip template — see it in context

Installation

$ npx shadcn@latest add https://framebrick.co/r/blocks/stats-chart.json

Usage

import { StatsChart } from "@/components/stats-chart";

<StatsChart
  label="Who we are"
  title="We combine creativity, data and honest storytelling."
  stats={[
    { value: 95, label: "Marketing strategy" },
    { value: 88, label: "Social media" },
  ]}
/>

Props

PropTypeDefaultDescription
labelstringWho we areSmall muted line above the heading.
titlestring—Section heading (h2).
paragraphsstring[]—Text in a 400px column under the heading.
action{ label, href }More about usButton under the paragraphs.
stats{ value: number, label }[]5 statsPercentages (0–100); one bar each.
classNamestring—Classes for the <section>.
  • The text is centered in a 48rem column; the chart spans the container, 350px tall from 640px and stacked below.
  • Bars grow once half the chart is in view, 50ms apart, their height and shade following their value (stat-bars, which handles reduced motion).

AI prompt

Paste into v0, Lovable, Bolt or Claude to rebuild this block in your own project.

Create a React + Tailwind CSS + Motion block called StatsChart (Next.js).
- <section className="py-(--section-y)">, container mx-auto max-w-(--container) px-(--gutter), column centered, gap-16 / md:gap-20 / lg:gap-24.
- Text (max-w-3xl, gap-12): a small muted label over an h2 (font-heading text-h2 semibold tracking-tight); then a 400px column of muted
  paragraphs and a shadcn-style button.
- Chart: one bar per stat in a row 350px tall from 640px (items-end, gap-1.5), stacked horizontal bars below. Bars are rounded-md
  bg-primary text-primary-foreground with the value (text-xl semibold) and label; height = value% of the row and opacity following the
  value. When half the chart is in view the bars grow from 30% to their value, 50ms apart. Honour reduced motion yourself (the height
  comes from a CSS variable, which MotionConfig does not skip).
- Only shadcn variables and block tokens.

Be the first to know

Get new templates and components first

One short email when we release a template or a free component. No spam — unsubscribe anytime.

We use your email only for Framebrick updates. Privacy policy