Animates a number from a start value to a target value using a smooth ease-out curve. Triggered by IntersectionObserver — the animation fires once when the element enters the viewport. Add prefix, suffix, and separator for formatted output.
Total Users
Uptime
Daily Revenue
Control animation speed with [duration] in milliseconds. Defaults to 1500.
500ms
1500ms (default)
3000ms
Combine with base-stat-card or any layout for live dashboard-style KPI bars.
Downloads
Stars
Uptime
Components
Run the following command to add this component to your project:
npx base-ui-cli add animated-counter
For AI agents
Copy a prompt with the registry name, CLI install, and import — or add the Base UI MCP server.
npx -y base-ui-mcp
Base UI provides standalone components. Import the exact elements you want to use into your component.
// Install: npx base-ui-cli add animated-counter
// Paths are relative to aliases.components (default: src/app/components)
import { AnimatedCounterComponent } from './animated-counter/animated-counter.component';
@Component({
selector: 'app-your-component',
imports: [
AnimatedCounterComponent
],
template: `...`
})
export class YourComponent {} API for animated-counter — generated from JSDoc in the library source.
| API | Member | Type | Default | Description |
|---|---|---|---|---|
base-animated-counter | class | string | '' | Additional host CSS classes (merged via cn()). |
base-animated-counter | value | number | 0 | — |
base-animated-counter | from | number | 0 | — |
base-animated-counter | duration | number | 1500 | — |
base-animated-counter | decimals | number | 0 | — |
base-animated-counter | prefix | string | '' | — |
base-animated-counter | suffix | string | '' | — |
base-animated-counter | separator | unknown | ',' | — |
Content