useCountdown
jsxhook
useCountdown: counts down from a start value with start, pause, and reset controls
Terminal
$termuijs render use-countdown
Installation
$ bunx termuijs add use-countdown
Copies the source into src/components/use-countdown/ and installs @termuijs/jsx.
Usage
ts
import { useCountdown } from '@termuijs/jsx'ts
const { value, set, reset } = useCountdown({
initial: undefined,
})API Reference
useCountdown
| Prop | Type | Default | Description |
|---|---|---|---|
initial | T | undefined | — | Initial value |
persist | boolean | false | Persist to storage |
key | string | — | Storage key |