# Timer

<flow-timer>
Reactive Stable

The timer component displays a standard Flo.w timer control.

The timer component is designed to be used as the primary time control for Flo.w time-based visualizations. Specify a Flo.w reactive state property using the timer-state attribute to bind the state property to the current timer value. Flo.w reactive queries and computed state that depend on the specified 'time' state property will be re-evaluated when the timer changes.

The timer value, by default, is an ISO8601 date/time string and can be used directly in Flo.w reactive queries. Set the timer-state-format to millis if epoch milliseconds are required instead.

TIP

The bound state property is updated according to the update-interval attribute (default 10s). This allows visualization updates to run at a lower frequency than the natural 1 second update of the timer.

The timer operates in two modes:

  • running - the timer is set to 'real time' and updates every second.
  • paused - the timer is set to a specific time and does not update automatically.

Selecting a date/time with the timer step controls or the popup calendar will set the timer to paused mode. Clicking the play button switches the timer to 'real time' running mode. The mode can also be set programmatically using the running attribute.

WARNING

Due to an outstanding bug, popup calendars will not be positioned correctly if any ancestor element of the timer component is a positioned element (i.e. CSS position property is relative or absolute). Specify the static attribute on the component as a workaround.

# Examples

# Theme

The timer supports Flo.w theming and a light and dark theme are provided as standard.