Cooldown button
A button that has to rest after it is used: resend a code, retry a payment, nudge a teammate. A ring drains beside the label while the clock rolls down, a soft flash says it is ready, and it stays focusable while it waits, so the keyboard never loses its place.
When to use
- Sending codes and emails that the server rate-limits.
- Retries that should not be hammered.
When not to use
- Waits longer than a few minutes; say when it will be possible instead.
- Disabling a form for validation; explain the problem instead.
Installation
pnpm dlx shadcn@latest add @caliper/cooldown-button
Adds its 2 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
API reference
CooldownButton
4 props
Also accepts the native props of its root element and a ref.
Keyboard
- No custom key handling; Tab and the native activation keys do the work.
Accessibility
It is built on native elements and keeps aria-disabled and aria-hidden in step with state.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/cooldown-button.mdThe index of every part is at /llms.txt.