ComponentsStopwatch
Stopwatch
stableCount-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 stop•r reset•q quit
stopwatch.tsx
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
- Copy and paste the following code into your project.
- Update import paths to match your project setup.
components/ui/orizen/stopwatch.tsx
Usage
stopwatch.imports.tsx
stopwatch.example.tsx
Examples
Variants
stopwatch.example1.tsx
Elapsed: 00:00
s stop•r reset•q quit
stopwatch.example1.tsx
API Reference
Stopwatch
PropTypeDefaultDescription
runningbooleantrueWhether the stopwatch is counting up
runningtrue
booleanWhether the stopwatch is counting up
labelstringundefinedText shown before the elapsed time
labelundefined
stringText shown before the elapsed time