# Stats Section

> A React stats section of big numbers with labels: plain figures, cards, hairline columns, an inverted band or a split grid, rolling up on view.

- Type: React block (Marketing Sections)
- Access: Pro (the source needs a Wingo UI Pro plan, see https://wingo-ui.com/pricing)
- Version: 1.0.0
- Install: `npx wingo-ui@latest add stats-section`
- Docs: https://wingo-ui.com/components/stats-section

## Interaction

The server and screenshots render the final numbers. The first time the list scrolls into view on the client, each number drops to zero and its digits roll up to the value (off under reduced motion or with countUp off). Numbers are formatted with the locale's group and decimal marks. Four stats sit two by two on phones and in one row from 1024px; each label is a <dt> read before its value.

## Installation

```bash
npx wingo-ui@latest add stats-section
```

Pro item: run `npx wingo-ui@latest login` once with a Pro account. The CLI adds the files, their dependencies and a version record for updates.

With shadcn: `npx shadcn@latest add @wingo-ui/stats-section` (needs the @wingo-ui registry with your API key in components.json)

Files:

- `components/blocks/stats-section.tsx`

Wingo UI dependencies (installed automatically):

- [Marketing Section](https://wingo-ui.com/components/marketing-section) ([Markdown](https://wingo-ui.com/components/marketing-section.md))
- [Animated Counter](https://wingo-ui.com/components/animated-counter) ([Markdown](https://wingo-ui.com/components/animated-counter.md))
- [Motion presets](https://wingo-ui.com/components/motion) ([Markdown](https://wingo-ui.com/components/motion.md))
- [Tones](https://wingo-ui.com/components/tones) ([Markdown](https://wingo-ui.com/components/tones.md))
- [UIProvider](https://wingo-ui.com/components/ui-config) ([Markdown](https://wingo-ui.com/components/ui-config.md))

## Usage

```tsx
// app/(marketing)/about/page.tsx
import { StatsSection } from "@/components/blocks/stats-section"

export default function AboutPage() {
  return (
    <StatsSection
      variant="cards"
      title="Acme in numbers"
      stats={[
        { value: 12000, suffix: "+", label: "Teams" },
        { value: 99.99, decimals: 2, suffix: "%", label: "Uptime" },
        { value: 38, suffix: "%", label: "Faster delivery" },
      ]}
    />
  )
}
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `eyebrow?` | `ReactNode` | `""` | The small uppercase line over the title. |
| `title?` | `ReactNode` | `"Small teams, big numbers"` | The section title; an empty string hides it. |
| `description?` | `ReactNode` | `"Acme keeps 12,000 teams in sync, from the first plan to the last release note."` | The paragraph under the title. |
| `actions?` | `ReactNode` |  | Buttons under the description. |
| `stats?` | `StatsSectionItem[]` | `"STATS_SECTION_SAMPLE"` | { value, decimals?, prefix?, suffix?, label, description? }; up to four per row. |
| `variant?` | `"plain" \| "cards" \| "divided" \| "band" \| "split"` | `"plain"` | Bare numbers, raised cards, numbers under a hairline, band (an inverted full-width strip with huge numbers and short labels; descriptions are left out, a non-neutral tone draws an accent bar) or split (the heading on the start side, a two by two grid of figures beside it, stacked on phones; always start aligned). |
| `align?` | `"start" \| "center"` | `"center"` | Where the heading and each stat sit. |
| `size?` | `"md" \| "lg"` | `"lg"` | Number size: md 26 to 40px, lg 30 to 56px. |
| `tone?` | `"neutral" \| "brand" \| "success" \| "warning" \| "danger" \| "info"` | `"neutral"` | The color of the numbers; neutral is the text color. |
| `countUp?` | `boolean` | `true` | Rolls the numbers up once when they first scroll into view. |
| `duration?` | `number` | `1.2` | Seconds each digit takes to settle. |
| `locale?` | `string` | `"en-US"` | Number formatting (group and decimal marks); default the UIProvider's locale, else en-US. |
| `background?` | `"none" \| "muted"` | `"none"` | A gray well behind the section. |
| `spacing?` | `"none" \| "sm" \| "md" \| "lg"` | `"md"` | Vertical padding, as in MarketingSection. |
| `divider?` | `boolean` | `false` | A hairline above the section. |
| `className?` | `string` |  | Classes for the <section>. |
| `classNames?` | `Partial<Record<StatsSectionSlot, string>>` |  | Classes for container, list, item, value, label and description. |

## Parts

### STATS_SECTION_SAMPLE (constant)

Four sample stats: 12,000+ teams, 99.99% uptime, 4.9/5 rating, 38% faster delivery.

### StatsSectionItem (type)

One stat: value, decimals, prefix, suffix, label and description.

### StatsSectionProps (type)

Props of StatsSection.

## Examples

- **Cards in a gray well**: Raised cards on the muted band, numbers in the brand orange.
- **Divided, start aligned**: Numbers under hairlines, read left to right, with a short intro.
- **Three stats, smaller**: Three columns at the medium size, no heading.
- **German number format**: locale de-DE writes 12.000 and 99,99.
- **Inverted band**: Huge numbers on a full-width strip in the primary color, with short labels.
- **Split with the heading**: The heading on the left and four figures in a two by two grid beside it.

## See also

- [Marketing Section](https://wingo-ui.com/components/marketing-section) ([Markdown](https://wingo-ui.com/components/marketing-section.md))
- [Animated Counter](https://wingo-ui.com/components/animated-counter) ([Markdown](https://wingo-ui.com/components/animated-counter.md))
- [Stat Card](https://wingo-ui.com/components/stat-card) ([Markdown](https://wingo-ui.com/components/stat-card.md))
- [Hero Section](https://wingo-ui.com/components/hero-section) ([Markdown](https://wingo-ui.com/components/hero-section.md))

---

Canonical: https://wingo-ui.com/components/stats-section
More components: https://wingo-ui.com/components · Index for agents: https://wingo-ui.com/llms.txt
