1.1.1 • Published 3 months ago

ngx-count-animation v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

npm version NPM monthly downloads NPM total downloads License: MIT Issues Web Demo

Table of contents

A package that elegantly animates number changes, creating a visually engaging transition from one value to another, perfect for counting or displaying real-time data updates.

Installation

npm install ngx-count-animation

Standalone component

import { Component } from '@angular/core';
import { NgxCountAnimationModule } from 'ngx-count-animation';

@Component({
  selector: 'app-root',
  standalone: true,
  templateUrl: './app.component.html',
  styleUrl: './app.component.scss',
  imports: [ NgxCountAnimationModule ],
})
export class AppComponent {}

Or for Module

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';

import { NgxCountAnimationModule } from 'ngx-count-animation';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    NgxCountAnimationModule,
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Inputs

OptionTypeDefaultComment
ngxCountAnimationnumberSets the target count for the count animation.
maximumFractionDigitsnumber0The maximum number of fraction digits to display.
minimumFractionDigitsnumber0The minimum number of fraction digits to display.
durationnumber2000Sets the duration of the count animation.
durationFromValuenumberSets the duration based on the given value.
highPerformancebooleantrueWhen highPerformance is false, an interval listener is active to detect layout changes.

Outputs

OptionTypeComment
startAnimationEventEmitterEmits an event at the start of the animation.
endAnimationEventEmitterEmits an event at the end of the animation.

Simple example

<div ngxCountAnimation="1000000"></div>

Complete example demonstrating all properties

 <div
      ngxCountAnimation="123456789"
      duration="2000"
      maximumFractionDigits="0"
      minimumFractionDigits="0"
      highPerformance="true"
    ></div>

Contributing

I welcome contributions from the open-source community to make this project even better. Whether you want to report a bug, suggest a new feature, or contribute code, I appreciate your help.

Bug Reports and Feature Requests

If you encounter a bug or have an idea for a new feature, please open an issue on my GitHub Issues page. I will review it and discuss the best approach to address it.

Code Contributions

If you'd like to contribute code to this project, please follow these steps:

  1. Fork the repository to your GitHub account.
  2. Clone your forked repository to your local machine.
git clone https://github.com/hm21/ngx-count-animation.git
1.1.1

3 months ago

1.1.0

3 months ago

1.0.7

4 months ago

1.0.6

4 months ago

1.0.5

4 months ago

1.0.4

5 months ago

1.0.3

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago