G
YouTube TikTok Games
Skip to content

About

Lightweight animated counter plugin for Angular, React, and Vanilla JS. Supports start, end, step, and timer inputs.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

๐Ÿš€ Counter Plugin (Angular)

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.


โœจ Features

  • โšก Lightweight and fast
  • ๐Ÿงฉ Built for Angular
  • ๐Ÿ”ง Fully customizable inputs
  • ๐ŸŽฏ Smooth animated number counting
  • ๐Ÿ” Optional repeat animation
  • ๐Ÿงฎ Supports prefix and suffix formatting

๐Ÿ“ฆ Installation

Install the package using npm:

npm install @nawazaideveloperr/counter-plugin

๐Ÿš€ Usage


Angular

Step 1: Import Module

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { CounterModule } from '@nawazaideveloperr/counter-plugin';

@NgModule({
  imports: [
    BrowserModule,
    CounterModule
  ]
})
export class AppModule {}

Step 2: Use Component

<lib-counter
  [start]="0"
  [end]="1000"
  [timer]="2000"
  [step]="2">
</lib-counter>

Angular Standalone Component

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 {}

โš™๏ธ Inputs / Props

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

๐ŸŽฏ Examples

Basic Counter

<lib-counter
  [start]="0"
  [end]="500"
  [timer]="1500"
  [step]="5">
</lib-counter>

Counter with Prefix

<lib-counter
  [start]="0"
  [end]="10000"
  [prefix]="'$'">
</lib-counter>

Output:

$10000

Counter with Suffix

<lib-counter
  [start]="0"
  [end]="100"
  [suffix]="'%'">
</lib-counter>

Output:

100%

Counter with Plus Sign

<lib-counter
  [start]="0"
  [end]="5000"
  [suffix]="'+'">
</lib-counter>

Output:

5000+

Counter with Repeat Animation

<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.


๐Ÿ’ก Use Cases

  • Dashboard statistics
  • Website visitor counters
  • Sales analytics
  • Marketing metrics
  • Portfolio statistics
  • Growth indicators

๐Ÿ“„ License

MIT License

GitHub: https://github.com/devloper2017/counter-plugin


โญ Support

If you like this project, please give it a star โญ on GitHub.

๐Ÿ‘‰ https://github.com/devloper2017/counter-plugin


๐Ÿค Contributing

Pull requests are welcome.

If you find a bug or want to improve the plugin:

  1. Fork the repository
  2. Create a new branch
  3. Make your changes
  4. Submit a pull request

About

Lightweight animated counter plugin for Angular, React, and Vanilla JS. Supports start, end, step, and timer inputs.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages