Stopwatch
llms.txtExample
Usage
<Stopwatch bind:stopwatch /> <Button onclick={() => stopwatch?.start()}>Start</Button>
API Reference
Stopwatch
A stopwatch display with animated digits. Bind to the stopwatch prop to control it programmatically (start, pause, resume, reset).
Property Type Description
stopwatch $bindable
StopwatchState
The stopwatch state object. Provides methods: start(), pause(), resume(), reset(), and properties: isRunning, isPaused, elapsed. Default: —
showHours
boolean
Whether to display the hours digits. Default:
falseshowMinutes
boolean
Whether to display the minutes digits. Default:
trueshowSeconds
boolean
Whether to display the seconds digits. Default:
trueclass
string
Additional CSS classes to apply. Default: —
ref $bindable
HTMLDivElement
The underlying DOM element. Default: —
Property
stopwatch
showHours
showMinutes
showSeconds
class
ref