Animated Stats
A group of statistics that count from 0 to their target values when they enter the viewport, with items staggering in and sliding up.
Bring this into your project
Run this command in your project folder. The CLI adds the source and dependencies; then follow the usage example below.
npx webberui@latest add animated-stats.enPlayground
Tune the props live — the code snippet updates as you go, so you can dial in the look you want before copying it.
<AnimatedStats/>
The complete example includes the preview layout and data. Install the component first, then paste this file into your project.
Installation
npx webberui@latest add https://webberui.com/r/animated-stats.en.jsonOr, once registries are configured in components.json, install it as @webberui/animated-stats.
Usage
import { AnimatedStats, StatItem } from "@/components/ui/animated-stats";
<AnimatedStats>
<StatItem value={120} suffix="+" label="Components" />
<StatItem value={98} suffix="%" label="Satisfaction" />
<StatItem value={3.2} suffix="s" decimals={1} label="Average install time" />
</AnimatedStats>Props
AnimatedStats
| Prop | Type | Default | Description |
|---|---|---|---|
children | React.ReactNode | — | The statistics (put StatItem here) |
delay | number | 0 | Delay before the reveal starts (seconds) |
stagger | number | 0.15 | Stagger interval between items (seconds) |
once | boolean | true | Play only the first time the element enters the viewport |
StatItem
| Prop | Type | Default | Description |
|---|---|---|---|
value | number | — | Target value; counts from 0 up to it |
label | string | — | Caption below the number |
prefix | string | "" | Prefix before the number (for example $) |
suffix | string | "" | Suffix after the number (for example +, %) |
decimals | number | 0 | Number of decimal places |
duration | number | 1.6 | Duration of the counting animation (seconds) |
Accessibility
- When the user has "reduce motion" enabled at the system level, the counting and the stagger are skipped and the final numbers are shown right away
- The number container carries an
aria-label(the final formatted value, including prefix and suffix), and the animating span that counts is hidden from assistive technology (aria-hidden), so screen readers announce only the final value
Magazine Pull Quote
A magazine-spread React testimonial with an oversized quotation mark, a large serif pull quote, a drop cap and two-column body copy; on entry the mark scales into place and the text reveals line by line, with page turning for multiple testimonials.
Avatar Stack
A row of overlapping circular avatars; on hover or focus the avatar lifts and scales up, its neighbours move aside, and a name tooltip floats out.