Font Awesome Build Awesome
Search ⌘KCtrl+K
Light Dark System Docs Color Scheme: System \ Default Awesome Shoelace Active Brutalist Glossy Matter Mellow Playful Premium Tailspin Docs Theme: Default Icon Style: Classic Regular
Solid Regular Light Thin Classic Sharp Duotone Sharp Duotone
Docs Most styles require Font Awesome Pro.
Server-Side Rendering: Off Server-Side Rendering Docs
View on GitHub
Start Components Docs Help Pro
Login Log into your account
Web Awesome Font Awesome Build Awesome
Search this site… /
Light Dark System Docs Color Scheme: System \ Default Awesome Shoelace Active Brutalist Glossy Matter Mellow Playful Premium Tailspin Docs Theme: Default Icon Style: Classic Regular
Solid Regular Light Thin Classic Sharp Duotone Sharp Duotone
Docs Most styles require Font Awesome Pro.
Server-Side Rendering: Off Server-Side Rendering Docs
View on GitHub
Components Pro

Getting Started

  • Installation
  • Usage
  • Forms
  • Localization
  • Frameworks
  • Using with AI
  • Figma Design Kit ProThis requires access to Web Awesome Pro
  • Server Rendering

Resources

  • Accessibility
  • Browser Support
  • Contributing
  • Patterns ProPatterns require access to Web Awesome Pro
  • Migrating from Shoelace
  • Visual Tests
  • Changelog
  • Help & Support

Theming & Utilities

  • Overview
  • Built-in Themes
  • Color Palettes
  • Design Tokens
  • Customizing & Theming
  • CSS Utilities

Actions

  • Button
  • Button Group
  • Copy Button
  • Dropdown
    • Dropdown Item

Forms

  • Checkbox
  • Checkbox Group
  • Color Picker
  • Combobox ProThis requires access to Web Awesome Pro
  • Date Input ProThis requires access to Web Awesome Pro
  • Date Picker ProThis requires access to Web Awesome Pro
  • File Input ProThis requires access to Web Awesome Pro
  • Input
  • Known Date
  • Number Input
  • OTP Input
  • Radio Group
    • Radio
  • Rating
  • Rich Text Editor ProThis requires access to Web Awesome Pro
  • Select
    • Option
  • Slider
  • Switch
  • Tag Input
  • Textarea
  • Time Input

Layout

  • Accordion
    • Accordion Item
  • Card
  • Details
  • Dialog
  • Divider
  • Drawer
  • Page
  • Scroller
  • Split Panel

Navigation

  • Breadcrumb
    • Breadcrumb Item
  • Pagination
  • Stepper
    • Step
  • Tab Group
    • Tab
    • Tab Panel
  • Tree
    • Tree Item

Feedback

  • Badge
  • Callout
  • Progress Bar
  • Progress Ring
  • Skeleton
  • Spinner
  • Tag
  • Toast
    • Toast Item
  • Tooltip

Media

  • Animated Image
  • Avatar
  • Carousel
    • Carousel Item
  • Code Highlighter
  • Comparison
  • Icon
  • Lightbox
    • Lightbox Item
  • Markdown
  • QR Code
  • Video ProThis requires access to Web Awesome Pro
  • Video Playlist ProThis requires access to Web Awesome Pro
  • Zoomable Frame

Data Viz ProThis requires access to Web Awesome Pro

  • Bar Chart
  • Bubble Chart
  • Data Grid
  • Doughnut Chart
  • Line Chart
  • Pie Chart
  • Polar Area Chart
  • Radar Chart
  • Scatter Chart
  • Sparkline
  • Advanced Usage

Helpers

  • Animation
  • Counter
  • Format Bytes
  • Format Date
  • Format Number
  • Include
  • Intersection Observer
  • Mutation Observer
  • Number Ticker
  • Popover
  • Popup
  • Random Content
  • Relative Time
  • Resize Observer

Number Ticker

  • Examples
  • Start & End Values
  • Duration & Delay
  • Easing
  • Decimal Places
  • Currency & Percent
  • Localization
  • Starting When in View
  • Customizing
  • Formatting the Value
  • Updating the Value
  • Reacting to Completion
  • Stat Cards
  • API
  • Importing
  • Attributes & Properties
  • Methods
  • Events
  • Custom States
  • SSR
On This Page...
  • Examples
  • Start & End Values
  • Duration & Delay
  • Easing
  • Decimal Places
  • Currency & Percent
  • Localization
  • Starting When in View
  • Customizing
  • Formatting the Value
  • Updating the Value
  • Reacting to Completion
  • Stat Cards
  • API
  • Importing
  • Attributes & Properties
  • Methods
  • Events
  • Custom States
  • SSR

Number Ticker

<wa-number-ticker>
Experimental Helpers Since 3.15

Number tickers count up or down to a value when they scroll into view and format it with the Intl.NumberFormat API. Use them for dashboard stats, landing page metrics, and running totals.

Restart
<div id="number-ticker-overview" class="wa-stack wa-align-items-start">
  <wa-number-ticker value="1000000" class="wa-heading-3xl"></wa-number-ticker>

  <wa-divider class="wa-align-self-stretch"></wa-divider>

  <wa-button appearance="filled">Restart</wa-button>
</div>

<script>
  const container = document.getElementById('number-ticker-overview');
  const ticker = container.querySelector('wa-number-ticker');

  container.querySelector('wa-button').addEventListener('click', () => ticker.restart());
</script>

Screen readers read the final value, but not the numbers in between. For a number that doesn't need to count, use format number instead.

Tickers respect the user's reduced motion preference.
When it's on, the final value shows right away and the ticker still emits the wa-finish event.

Examples

Link to This Section

Start & End Values

Link to This Section

Use the value attribute to set the number to count to. Tickers count from 0 by default. Set the start-value attribute to start from another number. Start higher than value to count down.

Up:

Down:

Restart
<div id="number-ticker-values" class="wa-stack wa-align-items-start">
  <p>Up: <wa-number-ticker value="100"></wa-number-ticker></p>
  <p>Down: <wa-number-ticker start-value="100" value="0"></wa-number-ticker></p>

  <wa-divider class="wa-align-self-stretch"></wa-divider>

  <wa-button appearance="filled">Restart</wa-button>
</div>

<script>
  const container = document.getElementById('number-ticker-values');
  const tickers = container.querySelectorAll('wa-number-ticker');

  container.querySelector('wa-button').addEventListener('click', () => tickers.forEach(ticker => ticker.restart()));
</script>

Duration & Delay

Link to This Section

Use the duration attribute to set the longest a count can take, in milliseconds. A count ends early once the number stops changing. The delay attribute waits before counting from the start value. Later changes to value aren't delayed.

Keep counts under five seconds. A ticker can't be paused, and WCAG asks for a pause control on motion that runs longer.

4 seconds:

1 second, after a 1 second delay:

Restart
<div id="number-ticker-duration" class="wa-stack wa-align-items-start">
  <p>4 seconds: <wa-number-ticker value="500" duration="4000"></wa-number-ticker></p>
  <p>
    1 second, after a 1 second delay: <wa-number-ticker value="500" duration="1000" delay="1000"></wa-number-ticker>
  </p>

  <wa-divider class="wa-align-self-stretch"></wa-divider>

  <wa-button appearance="filled">Restart</wa-button>
</div>

<script>
  const container = document.getElementById('number-ticker-duration');
  const tickers = container.querySelectorAll('wa-number-ticker');

  container.querySelector('wa-button').addEventListener('click', () => tickers.forEach(ticker => ticker.restart()));
</script>

Easing

Link to This Section

Use the easing attribute to change how the count speeds up and slows down. It accepts any CSS easing function, such as linear, ease-in-out, or steps(). The named easings from animation aren't supported. They fall back to the default, like any other invalid value.

default linear ease-in-out steps(10)
Restart
<div id="number-ticker-easing" class="wa-stack wa-align-items-start">
  <div class="number-ticker-easing-grid">
    <code>default</code>
    <wa-number-ticker value="1000" duration="3000"></wa-number-ticker>
    <code>linear</code>
    <wa-number-ticker value="1000" duration="3000" easing="linear"></wa-number-ticker>
    <code>ease-in-out</code>
    <wa-number-ticker value="1000" duration="3000" easing="ease-in-out"></wa-number-ticker>
    <code>steps(10)</code>
    <wa-number-ticker value="1000" duration="3000" easing="steps(10)"></wa-number-ticker>
  </div>

  <wa-divider class="wa-align-self-stretch"></wa-divider>

  <wa-button appearance="filled">Restart</wa-button>
</div>

<style>
  .number-ticker-easing-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    align-items: baseline;
    justify-items: start;
    gap: var(--wa-space-xs) var(--wa-space-l);
  }
</style>

<script>
  const container = document.getElementById('number-ticker-easing');
  const tickers = container.querySelectorAll('wa-number-ticker');

  container.querySelector('wa-button').addEventListener('click', () => tickers.forEach(ticker => ticker.restart()));
</script>

Decimal Places

Link to This Section

Tickers keep as many decimal places as the value and start-value attributes have, so 99.5 counts in tenths. Use the minimum-fraction-digits or maximum-fraction-digits attribute to set them yourself. Setting one applies to both, so the number of decimal places stays the same during the count. Currency and percent use the locale's usual decimal places instead.

Default:

Always two places:

Restart
<div id="number-ticker-decimals" class="wa-stack wa-align-items-start">
  <p>Default: <wa-number-ticker value="99.5"></wa-number-ticker></p>
  <p>Always two places: <wa-number-ticker value="99.5" maximum-fraction-digits="2"></wa-number-ticker></p>

  <wa-divider class="wa-align-self-stretch"></wa-divider>

  <wa-button appearance="filled">Restart</wa-button>
</div>

<script>
  const container = document.getElementById('number-ticker-decimals');
  const tickers = container.querySelectorAll('wa-number-ticker');

  container.querySelector('wa-button').addEventListener('click', () => tickers.forEach(ticker => ticker.restart()));
</script>

Currency & Percent

Link to This Section

Set the type attribute to currency or percent to change how the number is formatted. Use the currency attribute to set the ISO 4217 currency code, which is USD by default. Percent values are fractions, so 0.87 shows as 87%. For more options, such as currency-display and without-grouping, see format number.

Raised:

Funded:

Restart
<div id="number-ticker-type" class="wa-stack wa-align-items-start">
  <p>Raised: <wa-number-ticker type="currency" currency="EUR" value="18452.75"></wa-number-ticker></p>
  <p>Funded: <wa-number-ticker type="percent" value="0.87"></wa-number-ticker></p>

  <wa-divider class="wa-align-self-stretch"></wa-divider>

  <wa-button appearance="filled">Restart</wa-button>
</div>

<script>
  const container = document.getElementById('number-ticker-type');
  const tickers = container.querySelectorAll('wa-number-ticker');

  container.querySelector('wa-button').addEventListener('click', () => tickers.forEach(ticker => ticker.restart()));
</script>

Localization

Link to This Section

Use the lang attribute to set the number formatting locale. Localization is handled by the browser's Intl.NumberFormat API. No language packs are required.

English (US):

German:

English (India):

Arabic (Egypt):

Restart
<div id="number-ticker-lang" class="wa-stack wa-align-items-start">
  <p>English (US): <wa-number-ticker value="1234567.89" lang="en-US"></wa-number-ticker></p>
  <p>German: <wa-number-ticker value="1234567.89" lang="de"></wa-number-ticker></p>
  <p>English (India): <wa-number-ticker value="1234567.89" lang="en-IN"></wa-number-ticker></p>
  <p>Arabic (Egypt): <wa-number-ticker value="1234567.89" lang="ar-EG"></wa-number-ticker></p>

  <wa-divider class="wa-align-self-stretch"></wa-divider>

  <wa-button appearance="filled">Restart</wa-button>
</div>

<script>
  const container = document.getElementById('number-ticker-lang');
  const tickers = container.querySelectorAll('wa-number-ticker');

  container.querySelector('wa-button').addEventListener('click', () => tickers.forEach(ticker => ticker.restart()));
</script>

Starting When in View

Link to This Section

Tickers wait until they're at least halfway into view before they start counting. A ticker inside a hidden container, such as closed details, starts when it's shown. Use the eager attribute to start counting right away instead. Call the restart() method to play a ticker again.

Open both panels. The first ticker counts as it opens. The second is eager, so it finished while it was closed.

<div class="wa-stack">
  <wa-details summary="Default">
    <wa-number-ticker value="4096" class="wa-heading-2xl"></wa-number-ticker>
  </wa-details>
  <wa-details summary="Eager">
    <wa-number-ticker value="4096" class="wa-heading-2xl" eager></wa-number-ticker>
  </wa-details>
</div>

Customizing

Link to This Section

Style a ticker with regular CSS. The <wa-number-ticker> element holds the text itself, so color, font-size, and font-weight go right on it. Tickers use tabular figures so digits don't shift as they change.

While a ticker counts, it has the counting custom state, so wa-number-ticker:state(counting) targets it. This example dims each number until it finishes counting.

Divs Centered
Bugs Squashed
Days Since a Friday Deploy
Restart
<div id="number-ticker-customizing" class="wa-stack wa-align-items-start">
  <div class="wa-cluster wa-gap-2xl">
    <div class="wa-stack wa-gap-2xs">
      <span class="wa-caption-m">Divs Centered</span>
      <wa-number-ticker value="48210" class="number-ticker-stat brand"></wa-number-ticker>
    </div>
    <div class="wa-stack wa-gap-2xs">
      <span class="wa-caption-m">Bugs Squashed</span>
      <wa-number-ticker value="1337" class="number-ticker-stat success"></wa-number-ticker>
    </div>
    <div class="wa-stack wa-gap-2xs">
      <span class="wa-caption-m">Days Since a Friday Deploy</span>
      <wa-number-ticker start-value="128" value="0" class="number-ticker-stat danger"></wa-number-ticker>
    </div>
  </div>

  <wa-divider class="wa-align-self-stretch"></wa-divider>

  <wa-button appearance="filled">Restart</wa-button>
</div>

<style>
  .number-ticker-stat {
    font-size: var(--wa-font-size-3xl);
    font-weight: var(--wa-font-weight-bold);
    line-height: var(--wa-line-height-condensed);
    transition: opacity var(--wa-transition-normal) var(--wa-transition-easing);

    &:state(counting) {
      opacity: 0.7;
    }

    &.brand {
      color: var(--wa-color-brand-on-quiet);
    }

    &.success {
      color: var(--wa-color-success-on-quiet);
    }

    &.danger {
      color: var(--wa-color-danger-on-quiet);
    }
  }
</style>

<script>
  const container = document.getElementById('number-ticker-customizing');
  const tickers = container.querySelectorAll('wa-number-ticker');

  container.querySelector('wa-button').addEventListener('click', () => tickers.forEach(ticker => ticker.restart()));
</script>

A ticker inherits the text style around it, so it also works inside a sentence.

Web Awesome runs on coffee. Cups brewed so far:

Restart
<div id="number-ticker-inline" class="wa-stack wa-align-items-start">
  <p>
    Web Awesome runs on coffee. Cups brewed so far:
    <wa-number-ticker value="1204" style="font-weight: var(--wa-font-weight-bold)"></wa-number-ticker>
  </p>

  <wa-divider class="wa-align-self-stretch"></wa-divider>

  <wa-button appearance="filled">Restart</wa-button>
</div>

<script>
  const container = document.getElementById('number-ticker-inline');
  const ticker = container.querySelector('wa-number-ticker');

  container.querySelector('wa-button').addEventListener('click', () => ticker.restart());
</script>

Formatting the Value

Link to This Section

For other formats, set the valueFormatter property to a function that accepts a number and returns a formatted string. The function replaces the formatting attributes and receives unrounded numbers during the count, so round them as needed. The example below uses the Intl.NumberFormat API for compact numbers.

A prefix or suffix doesn't need a formatter. Place the text next to the ticker instead.

downloads

Restart
<div id="number-ticker-formatter" class="wa-stack wa-align-items-start">
  <p><wa-number-ticker value="2500000" class="wa-heading-2xl"></wa-number-ticker> downloads</p>

  <wa-divider class="wa-align-self-stretch"></wa-divider>

  <wa-button appearance="filled">Restart</wa-button>
</div>

<script>
  const container = document.getElementById('number-ticker-formatter');
  const ticker = container.querySelector('wa-number-ticker');
  const formatter = new Intl.NumberFormat('en', { notation: 'compact', maximumFractionDigits: 1 });

  ticker.valueFormatter = value => formatter.format(value);
  container.querySelector('wa-button').addEventListener('click', () => ticker.restart());
</script>

Updating the Value

Link to This Section

Change the value attribute to count from the number currently shown to the new one. Screen readers announce the new value once it finishes counting.

Score:

Add 50 Points
<div id="number-ticker-update" class="wa-stack wa-align-items-start">
  <p>Score: <wa-number-ticker value="100" duration="1000" class="wa-heading-2xl"></wa-number-ticker></p>

  <wa-divider class="wa-align-self-stretch"></wa-divider>

  <wa-button appearance="filled">Add 50 Points</wa-button>
</div>

<script>
  const container = document.getElementById('number-ticker-update');
  const ticker = container.querySelector('wa-number-ticker');

  container.querySelector('wa-button').addEventListener('click', () => (ticker.value += 50));
</script>

Reacting to Completion

Link to This Section

The ticker emits the wa-finish event each time it finishes counting. Listen for this event to reveal related content or start another animation.

Goal Reached
Restart
<div id="number-ticker-finish" class="wa-stack wa-align-items-start">
  <div class="wa-cluster wa-align-items-center">
    <wa-number-ticker
      type="currency"
      value="50000"
      maximum-fraction-digits="0"
      duration="3000"
      class="wa-heading-2xl"
    ></wa-number-ticker>
    <wa-badge variant="success" hidden>Goal Reached</wa-badge>
  </div>

  <wa-divider class="wa-align-self-stretch"></wa-divider>

  <wa-button appearance="filled">Restart</wa-button>
</div>

<script>
  const container = document.getElementById('number-ticker-finish');
  const ticker = container.querySelector('wa-number-ticker');
  const badge = container.querySelector('wa-badge');

  ticker.addEventListener('wa-finish', () => (badge.hidden = false));
  container.querySelector('wa-button').addEventListener('click', () => {
    badge.hidden = true;
    ticker.restart();
  });
</script>

Stat Cards

Link to This Section

Combine a ticker with a card, a badge, and a sparkline to create a stat card that counts up as it scrolls into view.

Monthly Revenue +12.4%
Up from $74,950 last month
Restart
<div id="number-ticker-stat-card" class="wa-stack wa-align-items-start">
  <wa-card style="width: 100%; max-width: 22rem">
    <div class="wa-stack wa-gap-s">
      <div class="wa-split">
        <span class="wa-caption-m">Monthly Revenue</span>
        <wa-badge variant="success" appearance="filled" pill>+12.4%</wa-badge>
      </div>
      <wa-number-ticker
        type="currency"
        value="84250"
        maximum-fraction-digits="0"
        class="wa-heading-2xl"
      ></wa-number-ticker>
      <wa-sparkline
        trend="positive"
        appearance="gradient"
        curve="natural"
        data="52 55 54 60 58 64 63 70 68 72 75 84"
        label="Monthly revenue rising over the last 12 months"
        style="width: 100%; height: 3rem"
      ></wa-sparkline>
      <span class="wa-caption-s">Up from $74,950 last month</span>
    </div>
  </wa-card>

  <wa-divider class="wa-align-self-stretch"></wa-divider>

  <wa-button appearance="filled">Restart</wa-button>
</div>

<script>
  const container = document.getElementById('number-ticker-stat-card');
  const ticker = container.querySelector('wa-number-ticker');

  container.querySelector('wa-button').addEventListener('click', () => ticker.restart());
</script>

API

Link to This Section

Importing

Link to This Section

If you're using the autoloader or a hosted project, components load on demand — no manual import needed. To cherry-pick a component manually, use one of the following snippets.

CDN npm Self-Hosted React

Import this component directly from the CDN:

import 'https://ka-f.webawesome.com/[email protected]/components/number-ticker/number-ticker.js';

After installing Web Awesome via npm, import this component:

import '@awesome.me/webawesome/dist/components/number-ticker/number-ticker.js';

If you're self-hosting Web Awesome, import this component from your server:

import './webawesome/dist/components/number-ticker/number-ticker.js';

To import this component for React 18 or below, use the following code:

import WaNumberTicker from '@awesome.me/webawesome/dist/react/number-ticker/index.js';

Attributes & Properties

Link to This Section

Learn more about attributes and properties.

Name Description Reflects
currency
currency
The ISO 4217 currency code to use when formatting.
Type string
Default 'USD'
currencyDisplay
currency-display
How to display the currency.
Type 'symbol' | 'narrowSymbol' | 'code' | 'name'
Default 'symbol'
delay
delay
The number of milliseconds to wait before counting from the start value. Later value changes aren't delayed.
Type number
Default 0
duration
duration
The longest a count can take, in milliseconds. A count ends early once the number shown stops changing. Set to 0 to skip the animation.
Type number
Default 2000
eager
eager
Starts counting right away instead of waiting until the ticker scrolls into view.
Type boolean
Default false
easing
easing
The easing function to use for counting. Accepts any CSS easing function, such as linear, ease-in-out, cubic-bezier(), steps(), or linear(). Invalid values fall back to the default.
Type string
Default 'cubic-bezier(0.16, 1, 0.3, 1)'
maximumFractionDigits
maximum-fraction-digits
The maximum number of fraction digits to use. Possible values are 0-100. If only one fraction digit option is set, it's used for both.
Type number
maximumSignificantDigits
maximum-significant-digits
The maximum number of significant digits to use. Possible values are 1-21.
Type number
minimumFractionDigits
minimum-fraction-digits
The minimum number of fraction digits to use. Possible values are 0-100. If only one fraction digit option is set, it's used for both.
Type number
minimumIntegerDigits
minimum-integer-digits
The minimum number of integer digits to use. Possible values are 1-21.
Type number
minimumSignificantDigits
minimum-significant-digits
The minimum number of significant digits to use. Possible values are 1-21.
Type number
startValue
start-value
The number to count from on the first run and when restart() is called.
Type number
Default 0
type
type
The formatting style to use.
Type 'currency' | 'decimal' | 'percent'
Default 'decimal'
value
value
The number to count to. Once the ticker has started, changing it counts from the number currently displayed to the new value.
Type number
Default 0
valueFormatter
A custom formatting function to apply to the number. When set, the formatting properties are ignored. Must be set with JavaScript. Property only.
Type (value: number) => string
withoutGrouping
without-grouping
Turns off grouping separators.
Type boolean
Default false

Methods

Link to This Section

Learn more about methods.

Name Description Arguments
restart() Plays the ticker again from startValue to value.

Events

Link to This Section

Learn more about events.

Name Description
wa-finish Emitted when the ticker finishes counting.

Custom States

Link to This Section

Learn more about custom states.

Name Description CSS selector
counting Applied while the number is counting. :state(counting)

SSR

Link to This Section

Learn more about Server-Side Rendering (SSR).

<wa-number-ticker> renders its start value during SSR, but won't start counting until it hydrates on the client and scrolls into view.

Need a hand? Report a bug Ask for help
Go Make Something Awesome
Version 3.15.0 © Fonticons, Inc.
  • Terms
  • Privacy
  • Refunds
  • Core License
  • Pro License

Quick Links

  • Components
  • CSS Utilities
  • Theming
  • Using with AI
  • Changelog
  • Help & Support

Recent Searches

    D'oh! No results for “”

    Suggest on GitHub Ask on Discord
    Navigate Select
    Close Esc

    We Have Cookies…

    We use cookies to make webawesome.com work better by storing limited information about your usage.

    We value your privacy, so we won't use them for evil or ask you to join the dark side.

    Customize
    Necessary Only Accept All
    Strictly Necessary
    Required to make the site function correctly — cannot be turned off
    Functionality Analytics
    Cancel Confirm Cookie Choices