--- title: Countup summary: A countup element is used to display numerical data in an interesting way and make the interface more interactive. libs: countup description: Display numbers dynamically with countups. --- The countup component is used to display numbers dynamically. It is a great way to make the interface more interactive and engaging. The countup component is a simple and easy way to animate numbers in your application. To be able to use the countup in your application you will need to install the countup.js dependency with `npm install countup.js`. For more advanced features of countups, click [here](https://inorganik.github.io/countUp.js/) and see what more you can do. ## Basic usage To create a countup, add `data-countup` to any HTML text tag and specify the number which is to be reached. The animation will be triggered as soon as the number enters the viewport. ```html

30000

``` The results can be seen in the example below. ```html example libs="countup" centered

30000

``` ## Duration Set the `duration` to determine how long the animation should take. By default, the duration is set to 2 seconds, but you can modify it as you wish. ```html

30000

``` Look at the example below to see how the duration affects the animation. ```html example libs="countup" centered vertical separated

30000

30000

30000

``` ## Starting value By default the countup will start from zero. If you want to set a different start value use `startVal`. You can also set the start value to be greater than the final value, so that it counts down instead of up. ```html

30000

``` To see how the starting value affects the animation, look at the example below. ```html example libs="countup" centered vertical separated

30000

30000

``` ## Decimal places Set how many decimal numbers should be displayed using `decimalPlaces`. By default, the number of decimal places is set to 0. ```html

3.123

``` Look at the example below to see how the number of decimal places affects the animation. ```html example libs="countup" centered vertical separated height="20rem"

3.123

3.123

3.123

3.123

``` ## Easing Disable easing using `"useEasing": false`. Easing is set to `true` by default, so that the animation speed changes over the course of its duration. Easing can be disabled to make the animation linear. ```html

30000

``` Look at the example below to see how easing affects the animation. ```html example libs="countup" centered vertical separated

30000

30000

``` ## Use grouping Disable grouping using `"useGrouping": false`. Grouping is set to `true` by default, so that the number is displayed with a separator. ```html

30000

``` Example below shows how grouping affects the animation. ```html example libs="countup" centered vertical separated

30000

30000

``` ## Separator You can change the default separator using `separator` and specifying the one you wish to use. ```html

3000000

``` This example shows how the separator affects the animation. ```html example libs="countup" centered vertical separated

3000000

3000000

``` ## Decimal separator You can change the default decimal separator using `decimal` and specifying the one you wish to use. ```html

3.12

``` Look at the example below to see how the decimal separator affects the animation. ```html example libs="countup" centered vertical separated

3.12

3.12

``` ## Prefix Set the countup prefix using `prefix` and specifying the prefix you want to add, for instance a currency symbol. ```html

30000

``` Look at the example below to see how the prefix affects the animation. ```html example libs="countup" centered vertical separated

30000

30000

``` ## Suffix Set the countup suffix using `suffix` and specifying the suffix you want to add, for instance a percentage symbol. ```html

300

``` Look at the example below to see how the suffix affects the animation. ```html example libs="countup" centered vertical separated

300

300

```