Kinetik UI

Hold to Confirm

.md

Press and hold to confirm: a ring fills around the icon and turns into a check mark.

v1.0.0Live on web@shopify/react-native-skiareact-native-gesture-handlerreact-native-reanimatedreact-native-worklets
Component preview

Installation

Kinetik CLI
npx kinetik-ui add hold-to-confirm

The CLI copies the source and installs native dependencies with npx expo install, so versions match your Expo SDK. With shadcn: npx shadcn@latest add https://kinetik-ui.dev/r/hold-to-confirm.json

Install manually

  1. Install dependencies
    npx expo install @shopify/react-native-skia react-native-gesture-handler react-native-reanimated react-native-worklets
  2. Copy the source files
    • components/kinetik/hold-to-confirm.tsx
    View source files

Usage

import { HoldToConfirm } from '@/components/kinetik/hold-to-confirm';

<HoldToConfirm
  label="Hold to delete project"
  confirmedLabel="Project deleted"
  tone="danger"
  onConfirm={deleteProject}
/>;

Holding for duration ms (1200 by default) confirms. Letting go or sliding the finger more than 40 pt away cancels and the ring unwinds.

When to use

  • Destructive or costly actions where a confirmation dialog would be heavy: delete, transfer, end a session.
  • Actions that should not fire from an accidental tap in a pocket or a scroll.

When not to use

  • Everyday actions. Holding is slower than tapping; reserve it for moments that deserve the pause.
  • Actions that need to be undone easily. Prefer an undo toast after a normal tap.

Notes

  • Screen-reader users confirm with a double tap and hold (the longpress accessibility action). A plain double tap explains how to use the control instead of confirming.
  • The ring and fill keep advancing under reduced motion because they show progress; only the press scale is reduced.
  • After resetAfter ms the button returns to idle. Pass null to keep it confirmed.

Props

HoldToConfirmProps

PropTypeDefaultDescription
labelrequiredstring—Label while idle, e.g. "Hold to delete".
onConfirmrequired() => void—
confirmedLabelstring'Done'Label once confirmed, e.g. "Deleted".
durationnumber1200Hold time in ms. Defaults to 1200.
tone'ember' | 'danger''ember'`danger` for destructive actions. Defaults to `ember`.
resetAfternumber | null1800Return to idle this many ms after confirming. `null` stays confirmed. Defaults to 1800.
disabledbooleanfalse
hapticsbooleantrueTicks at a third and two thirds, success on confirm. Defaults to true.
styleStyleProp<ViewStyle>—

Performance and accessibility

Performance

Budget
One linear timing and three trimmed Skia paths while holding; nothing runs at rest.
Measured

Pixel 9 emulator, API 35, release build · interaction median 1.20× the system Settings app on the same emulator (indicative only) · no frames drawn at rest · 153 MB app memory

Real-device measurement pending.

Accessibility

Reduced motion
The progress ring and fill still advance (they carry information); the press scale is reduced to 1%.
Screen readers
Button role. Double tap and hold ('longpress' action) confirms; a single double tap announces how to use it. Confirmation is announced.
Touch target
56 pt tall, at least 200 pt wide.

Source files

components/kinetik/hold-to-confirm.tsx is in the Code tab of the preview above.