TimeredCounter Documentation

website·Indexed 29 days ago

https://timered-counter.netlify.app

A library for creating scrolling number and data effects. Features include simple scrolling effects, custom animations, custom styling, localization (internationalization), and Vue integration. Supports import via CDN and provides a runtime API.

Tokens
5.2K
Snippets
27
Records
54
Agent score
72%

What's inside TimeredCounter

  1. Overview of TimeredCounter Web Component

    TimeredCounter is a Web Components library designed to display numerical changes with integrated animation effects. It is particularly useful for adding dynamic visual elements to landing pages, real-time data displays, and statistical counters. It leverages the Web Animation API for high performance and supports internationalization via the JavaScript Intl API.
  2. Use TimeredCounter via CDN (ES Module Build)

    Use the ES module build of TimeredCounter by specifying type="module" in the script tag. This is supported by most modern browsers.
    <script type="module" src="https://cdn.jsdelivr.net/npm/timered-counter/dist/timered-counter.esm-browser.js"></script>
    
    <div id="demo" style="font-size: 36px; text-align: center;">
      <timered-counter-string value="123456789" initial-value="0"></timered-counter-string>
    </div>
  3. Basic usage of TimeredCounter

    TimeredCounter automatically handles the animation of incrementing and decrementing numbers. To trigger an animation, you only need to update the numerical value provided to the component or instance; the library manages the transition and timing automatically.
  4. Use TimeredCounter via CDN (Global Build)

    Include the global build of TimeredCounter using a <script> tag. This exposes the API on a global TimeredCounter object and is suitable for static HTML pages without a build step.
    <script src="https://cdn.jsdelivr.net/npm/timered-counter/dist/timered-counter.global.js"></script>
    
    <div style="font-size: 36px; text-align: center;">
      <timered-counter-string value="123456789" initial-value="0"></timered-counter-string>
    </div>