A lightweight animated counter component for Angular.
Perfect for dashboards, statistics cards, analytics panels, and animated UI metrics.
The plugin supports customizable inputs like start, end, step, timer, and also prefix, suffix, and once for flexible UI counters.
- ⚡ Lightweight and fast
- 🧩 Built for Angular
- 🔧 Fully customizable inputs
- 🎯 Smooth animated number counting
- 🔁 Optional repeat animation
- 🧮 Supports prefix and suffix formatting
Install the package using npm:
npm install @nawazaideveloperr/counter-pluginimport { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { CounterModule } from '@nawazaideveloperr/counter-plugin';
@NgModule({
imports: [
BrowserModule,
CounterModule
]
})
export class AppModule {}<lib-counter
[start]="0"
[end]="1000"
[timer]="2000"
[step]="2">
</lib-counter>For Angular 15+ standalone components, you can import the module directly inside the component.
import { Component } from '@angular/core';
import { CounterModule } from '@nawazaideveloperr/counter-plugin';
@Component({
selector: 'app-home',
standalone: true,
imports: [CounterModule],
templateUrl: './home.component.html',
styleUrl: './home.component.scss',
})
export class HomeComponent {}| Input | Type | Default | Description |
|---|---|---|---|
| start | number | 0 | Starting number of the counter |
| end | number | 1000 | Ending number of the counter |
| timer | number | 1000 | Animation duration in milliseconds |
| step | number | 5 | Increment step size |
| prefix | string | "" | Text displayed before the number (example: $) |
| suffix | string | "" | Text displayed after the number (example: +, %) |
| once | boolean | true | If true, counter runs only once. If false, it can trigger multiple times |
<lib-counter
[start]="0"
[end]="500"
[timer]="1500"
[step]="5">
</lib-counter><lib-counter
[start]="0"
[end]="10000"
[prefix]="'$'">
</lib-counter>Output:
$10000
<lib-counter
[start]="0"
[end]="100"
[suffix]="'%'">
</lib-counter>Output:
100%
<lib-counter
[start]="0"
[end]="5000"
[suffix]="'+'">
</lib-counter>Output:
5000+
<lib-counter
[start]="0"
[end]="1000"
[timer]="2000"
[once]="false">
</lib-counter>If once is false, the counter animation can run multiple times when triggered.
- Dashboard statistics
- Website visitor counters
- Sales analytics
- Marketing metrics
- Portfolio statistics
- Growth indicators
MIT License
GitHub: https://github.com/devloper2017/counter-plugin
If you like this project, please give it a star ⭐ on GitHub.
👉 https://github.com/devloper2017/counter-plugin
Pull requests are welcome.
If you find a bug or want to improve the plugin:
- Fork the repository
- Create a new branch
- Make your changes
- Submit a pull request