Skip to content
Design System
GitHub

useLongPress

v0.5.1Beta

Press and hold with progress from 0 to 1.

Not cleared yet

Use long press hold to confirm

Install
npx shadcn add @syncrobotic/use-long-press

Overview

When to use

  • Hold-to-confirm actions, like stop all.

Use something else

Usage rules

  • Returns hold progress from 0 to 1. The emergency stop uses it for hold-to-stop-all.

Changelog

  • 0.5.12026-11-21The frame loop is declared inside the press handler instead of referring to itself before its declaration, so it is safe under the React Compiler. No visible change.
  • 0.5.02026-11-17First versioned release. Earlier history is in CHANGELOG.md.

How to upgrade