Animated Number Vue

1.0.0 · maintenance · verified Tue Apr 21

This package, `animated-number-vue` (version 1.0.0), provides a Vue 2 component designed to animate numerical values. It leverages the `animejs` library for its animation engine, offering smooth transitions for displaying numbers like prices, scores, or counts. Key features include configurable animation duration, delay, easing functions, and a `formatValue` prop for custom output formatting (e.g., currency, percentages). It also exposes callback props (`update`, `run`, `begin`, `complete`) for reacting to different stages of the animation lifecycle. Its primary differentiator is its simplicity and direct integration with Vue 2 projects, specifically using `animejs` for animation control. Given its explicit targeting of Vue 2, it is considered to be in a maintenance state, without active development or official support for Vue 3 or newer versions of the framework.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to import and use the AnimatedNumber component within a Vue 2 Single File Component, setting a dynamic value and applying a custom formatting function.

<template>
  <animated-number
    :value="value"
    :formatValue="formatToPrice"
    :duration="300"
  />
</template>
<script>
import AnimatedNumber from "animated-number-vue";

export default {
  components: {
    AnimatedNumber
  },
  data() {
    return {
      value: 1000
    };
  },
  methods: {
    formatToPrice(value) {
      return `R$ ${value.toFixed(2)}`;
    }
  }
};
</script>

view raw JSON →