ORIZEN/TUI

Timer

stable

Countdown timer with configurable duration and expiry callback.

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

timer.tsx
Exiting in 00:06
s stopr resetq quit

Installation

npx orizen-tui@latest add timer

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

timer.imports.tsx
timer.example.tsx

Examples

Usage

timer.example1.tsx
Exiting in 00:06
s stopr resetq quit

API Reference

Timer

durationMs
number

Countdown duration in milliseconds

labelundefined
string

Text shown before the time display

onExpireundefined
() => void

Callback fired when countdown reaches zero