You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

ngx-count-animation

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-count-animation

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.

3.1.0
latest
Source
npmnpm
Version published
Weekly downloads
35
-36.36%
Maintainers
1
Weekly downloads
 
Created
Source

Angular Count Animations

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

Demo Website

Table of contents

About

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.

Getting started

Installation

npm install ngx-count-animation

Import the directive

import { Component } from "@angular/core";
import { NgxCountAnimationDirective } from "ngx-count-animation";

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

Add provideNgxCountAnimations to your app.config.ts file as shown below.

export const appConfig: ApplicationConfig = {
  providers: [
    provideRouter(routes),
    provideClientHydration(),

    /// Add the code below
    provideNgxCountAnimations(),
  ],
};

Documentation

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.
enableLayoutChangeDetectionbooleantrueWhen enableLayoutChangeDetection is set to true, there is always an interval listener active that detects layout changes.

Outputs

OptionTypeComment
startAnimationoutputEmits an event at the start of the animation.
endAnimationoutputEmits an event at the end of the animation.

Example

Simple example

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

Complete example demonstrating all properties

<div ngxCountAnimation="123456789" duration="2000" maximumFractionDigits="0" minimumFractionDigits="0" enableLayoutChangeDetection="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:

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

Keywords

angular

FAQs

Package last updated on 30 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts