Carregando…
Carregando…
Carregando…Countdown to a target date or from N seconds, with optional days, labels and complete callback.
Countdown Timer — target date or seconds
$ npx kikitocn add countdown-timer@/lib/utilsimport { CountdownTimer } from "@/components/ui/cn/countdown-timer/CountdownTimer";
export function CountdownTimerExample() {
return (
<CountdownTimer />
);
}| Prop | Tipo | Padrão | Descrição |
|---|---|---|---|
targetDate | Date | string | undefined | Data/hora alvo (ISO string ou Date). Use targetDate OU seconds |
seconds | number | undefined | Segundos para contar regressivamente a partir de agora |
showDays | boolean | false | Exibe unidade de dias |
showLabels | boolean | true | Exibe rótulos (Horas, Min, Seg) abaixo dos números |
separator | string | ':' | Caractere separador entre as unidades |
onComplete | () => void | undefined | Callback quando o contador chega a zero |