ORIZEN/TUI
ComponentsStopwatch

Stopwatch

stable

Count-up elapsed time tracker with pause support.

Browser preview is a simulation. The copied component runs in actual terminal apps.

stopwatch.tsx
Elapsed: 00:00
s stopr resetq quit

Installation

npx orizen-tui@latest add stopwatch

if dependency install fails, run: npm install ink@^5.0.1 react@^18.3.1 @types/react@^18.3.18 orizen-tui-core@latest

Usage

stopwatch.imports.tsx
stopwatch.example.tsx

Examples

Variants

stopwatch.example1.tsx
Elapsed: 00:00
s stopr resetq quit

API Reference

Stopwatch

runningtrue
boolean

Whether the stopwatch is counting up

labelundefined
string

Text shown before the elapsed time