Skip to content

Broadcast timer

A widget that listen to a timer that is broadcasting its value every 1 second. This widget will display the value of the timer as a time value (e.g. 00:12)

Name Description
component button
options.listen.id id of the timer (required). This id should match of those of the timer being defined in layout action
options.interactive optional, if set to true, allow user to toggle between start and stop the timer

Example

Listen to timer and display its value as time value

{
    "component": "broadcast-timer",
    "options": {
        "listen": {
            "id": "test-timer"
        }
    }
}

Layout action that used timer (timer started when layout is initialized)

This example will launch layout with id of media-loader and use a timer with id of test-timer. It will also choose to display a timer at the header/app bar (styles.appBar.timer is set to show)

{
  "id": "media-loader",
  "timer": "test-timer",
  "styles": {
    "appBar": {
      "timer": "show"
    }
  }
}