Skip to content

Countdown

A countdown component that refreshes in real time, supports day/hour/minute/second formatting templates, emits oas-finish when reaching zero, and automatically cleans up its timer on disconnect.

Basic Usage

Default HH:mm:ss

Days, Hours, Minutes, Seconds

DD:HH:mm:ss template

Chinese Unit Template

Chinese units

Finish Callback

oas-finish event

API

Attributes

AttributeDescriptionTypeDefault
formatTemplate: DD/D days, HH/H hours, mm/m minutes, ss/s secondsstringHH:mm:ss
valueTotal countdown duration (milliseconds)string0

Events

EventDescription
oas-finishEmitted once when the countdown reaches zero

When the template contains D/DD, hours are counted within the day (0-23); without days, hours roll up into them (e.g. 25:01:01).