Skip to main content
2.0.61
Light Dark System
Compact Comfortable

Progress Tile

<zn-progress-tile> ZnProgressTile
Since 1.0 experimental

Progress tiles show a person and their status, with a bar filling up as their wait time runs out.

<zn-progress-tile class="progress-demo"
                  caption="John Doe"
                  status="Active"
                  avatar="JohnDoe@avatar"
                  wait-time="40">
</zn-progress-tile>

<script type="module">
  const now = Math.floor(Date.now() / 1000);
  const tile = document.querySelector('.progress-demo');
  tile.setAttribute('start-time', now - 95);
  tile.setAttribute('max-time', now - 600);
</script>

A progress tile tracks one conversation or task. All times are Unix times in seconds.

  • start-time is when it started. The total time on the right counts up from it.
  • max-time sets the scale of the top bar: the bar is full when the time since start-time reaches the time since max-time.
  • wait-time is how many seconds the person has been waiting. The lower bar fills as it approaches max-wait-time (default 300), amber from 60 seconds until half of max-wait-time, and red at the limit.
  • status is shown next to the wait time. avatar is any Icon src.

Examples

Waiting for an Agent

Add waiting-agent-response to show “Waiting for Agent” and count wait-time up every second.

<zn-progress-tile class="progress-waiting"
                  caption="Jane Cooper"
                  avatar="JaneCooper@avatar"
                  wait-time="100"
                  waiting-agent-response>
</zn-progress-tile>

<script type="module">
  const now = Math.floor(Date.now() / 1000);
  const tile = document.querySelector('.progress-waiting');
  tile.setAttribute('start-time', now - 400);
  tile.setAttribute('max-time', now - 600);
</script>

Ended

Set status="Ended" and an end-time to stop the clock: the total shows the time from start-time to end-time.

<zn-progress-tile caption="Cody Fisher"
                  status="Ended"
                  avatar="CodyFisher@avatar"
                  start-time="1743070000"
                  end-time="1743070845"
                  max-time="1743069000">
</zn-progress-tile>