This is a web component that allows you to create numerical animations on your website.
- 🌀 Works with any framework or no framework at all.
- 🍃 Lightweight and easy to use. (only <2kb gzipped)
- ⚙️ Support multiple attribute configurations including digital formatting, transition duration, etc.
pnpm i web-component-number-animation # or npm or yarn
import { NumberAnimation } from 'web-component-number-animation';
customElements.define('x-number-animation', NumberAnimation);
<x-number-animation to="12345.6789" />
Using ES Module
<script type="module">
import { NumberAnimation } from 'https://www.unpkg.com/web-component-number-animation/dist/number-animation.js';
customElements.define('x-number-animation', NumberAnimation);
</script>
<x-number-animation to="12345.6789" />
You can customize the behavior of the NumberAnimation component using the following props:
interface Props {
to: number;
from?: number;
precision?: number;
duration?: number;
locale?: string;
disabled?: boolean;
hideSeparator?: boolean;
}