Skip to content
IndexRequest a UIAboutContact

Hold to Delete Button

A destructive button that fills while you hold it and only fires when the bar completes; release early to cancel.

Open alone ↗

AI prompt

PROMPT: PASTE INTO YOUR AI CODING TOOL
Clean UI design of a red hold-to-delete button: a pill-shaped button with the label Hold to delete and a darker red fill covering about sixty percent of it from the left, a small trash icon at the left, below it a short grey hint Keep holding, flat modern style, light theme, subtle shadow. Variants: the empty state, the complete state reading Deleted with an Undo link, and a cancelled state with the fill rewinding. Negative: modal dialogs, heavy gradients, text errors, clutter. Reduced motion: static design.

About this pattern

Definition

Hold-to-confirm replaces a confirmation dialog for dangerous actions. The button fills over a fixed time while pressed; letting go early cancels and the fill rewinds. The delay is the confirmation, and it needs no extra screen.

Purpose & UX principles

  • Show progress as it fills, and a clear label that says Hold to delete.
  • Make the hold time match the risk: about one second for ordinary deletes, two for irreversible ones.
  • After completing, show the result and offer Undo where possible.

Interaction states

  • A Hold to delete button, three duration presets and an Undo after deleting.

Motion specification

  • The fill advances in real time over the chosen duration; releasing early rewinds in 200ms.
  • Reduced motion: the fill steps in quarters instead of sliding.

Responsive behaviour

  • Keyboard users hold Space or Enter; announce progress at the start and the end, not continuously.
  • Provide an alternative for users who cannot hold, such as a confirm dialog in settings.

Code

HTML
<div class="bx"><div class="pre" id="pre" role="group" aria-label="Duration"><button data-p="0" aria-pressed="false">Fast 0.8s</button><button data-p="1" aria-pressed="true">Normal 1.2s</button><button data-p="2" aria-pressed="false">Careful 2s</button></div><div class="ar"><button class="hd" id="hd" type="button" aria-describedby="hn"><i class="fl" id="fl"></i><span id="lb">Hold to delete</span></button><button class="mini" id="un" type="button" hidden>Undo</button></div><p class="out" id="hn" role="status">Press and hold. Keyboard: hold Space or Enter.</p></div>

Related patterns

Slide to Confirm

↗
Slide to ConfirmGestures & Touch

Type-to-Confirm Delete

↗
Type-to-Confirm DeleteOverlays & Dialogs

Press Feedback

↗
Press FeedbackButtons & Actions