count-up

The count-up component is a display-only component that continuously updates in real-time to show the elapsed time since a given start timestamp.

Count-up
Count-up

Configuration options

Some properties are common to all components, see Common component properties for a list and their configuration options.

Core structure

startTimestamp

Add a start date, date/time or time, in milliseconds either using:

  • datasource, e.g. [email protected][1].date

  • expression, e.g. =$toMillis('2025-05-19T10:43:04.377Z') If startTimestamp is omitted or set to null, the component remains static and does not count up.

Other options

labels

The count-up label displays time in the format Days: Hours: Minutes: Seconds. The Days section appears only when the timer exceeds 24 hours. Configuration options are:

  • isVisible (default: true)- Controls visibility of the count-up labels. Setting it to false hides the labels.

  • position - Determines whether the count-up labels (Days: Hours: Minutes: Seconds) appear at the top or bottom of the count-up display.

size

Choose between extra-large and medium sizes, with extra-large as the default if the property is not specified in the YAML.

Examples and code snippets

Count-up basic

This example shows how to set up a basic count-up component that starts counting from the current moment.

Examples: See the full code example in GitHub.

Basic count-up
Basic count-up
count-up-basic.jigx
title: Basic count-up
type: jig.default

header:
  type: component.jig-header
  options:
    height: medium
    children:
      type: component.image
      options:
        source:
          uri: https://cdn.pixabay.com/photo/2024/10/02/18/24/ai-generated-9091889_640.jpg

children:
- type: component.count-up
  options:
    # Set labels showing hours, minutes and seconds to visible.
    labels:
      isVisible: true
      # Position the labels under the count-up component.
      position: bottom
    # Set the required size of the component.  
    size: extra-large
    # Provide the start time.
    startTimestamp: =$now()

Count-up sizes and labels

Different sized count-ups
Different sized count-ups

This example displays two count-up components of different sizes. The first is extra-large, with labels positioned above it, while the second is medium-sized with labels below.

Examples: See the full code example in GitHub.

Count-up using a datasource

This example showcases two count-up components using a datasource with timestamp records in ISO format and milliseconds. The first component uses the millisecond timestamp, while the second uses the ISO format timestamp.

Examples: See the full code example in GitHub.

Count-up from a datasource
Count-up from a datasource

Count-up using state in a when condition

Count-up condition
Count-up condition

This example demonstrates how to use the jig state in a when property to initially hide the count-up component and reveal it when a start button is pressed within a list-item.

Examples: See the full code example in GitHub.

Last updated

Was this helpful?