Magoo Component UI logo Magoo Component UI
← Catalog

Time on Site

time-on-site molecule experimental

A count-up on-site timer card with a large elapsed clock, start time and Start/Pause/Stop controls.

Also in: Cards

The width preview needs a screen wider than the chosen width — use a larger device (or a desktop browser) to see the desktop and tablet layouts.

Default

Time on site

running

42:17

Started 9:12 AM

Complete

Time on site

complete

1:36:04

Started 8:00 AM

Props

NameTypeReq
started_at string
elapsed string
status enum (running | paused | complete)

Related components

How to use

The clock, start time, status badge and buttons are pure markup, so the card renders (and screenshots) without JavaScript at its initial elapsed value. behavior.js parses that displayed value back to seconds, then Start runs a one-second interval that increments and re-renders the clock, Pause halts it, and Stop halts it and dispatches "timer:stop" with { seconds }. The status badge colour follows the root's data-status via CSS group-data variants, so the behavior only sets the attribute and the label text. If the root initialises with data-status="running" the timer auto-starts. The portable self-init reads everything from the markup and cleans up its interval and listeners on teardown.

Use cases

cardcontrol WCAG AA SEO 20 dir: both ai-generated