SSE Hooks

useCountdown

GitHub
Custom hook that manages countdown.

Installation

npx sse-hooks add use-countdown

Usage

example.ts
import { useCountdown } from "./{hooks file}";

const [counter, { start, stop, reset }] = useCountdown({
  countStart: 10,
  intervalMs: 1000,
  isIncrement: false,
});

API

Parameters

Prop Default Type
countdownOptions-

CountdownOptions

The countdown's options.

Returns

Return Value Default Type
[0]-

number

[1]-

CountdownControllers

Types Aliases

No specific type aliases defined for this component.

Changelog

c165d — feat: enhance useRoleGuard and useSSR hooks with additional options and documentation

30da4 — feat: add new hooks and their metadata

cf13e — feat: add custom hooks for step navigation, ternary dark mode, timeout, toggle, unmount, and window size

Built with Love • © 2026