Hold To Delete Button

Use Hold To Delete Button for a destructive action that needs a deliberate confirmation gesture. The destructive fill reaches completion only when the control is held for the configured duration.

Preview

Reduce motion:Off
Tune:Off
Inspect

Installation

Basic usage

TypeScript
delete-project.tsx

Examples

Adjust the hold duration to reflect the impact of the action. Release before completion to cancel, and use disabled when deletion is unavailable.

Usage

API

PropertyTypeDefaultDescription
labelstring—Text displayed inside the button.
holdDurationnumber2000Duration in milliseconds the user must hold before the action triggers.
successDurationnumber1200Duration in milliseconds the success state is visible before auto-resetting.
onDelete() => void—Called once when the hold completes.
disabledbooleanfalseWhether the button ignores interaction.
classNamestring—Additional CSS classes for the button.

Accessibility

The control supports pointer capture and keyboard activation. Make the destructive result clear in the visible label and surrounding explanation.

Styling

Use the duration and class name options to match the context. Reduced-motion preferences retain the confirmation state without the animated fill.

Contact

Found a bug or need help using this component? Open an issue on GitHub.

License & Usage

Sona UI is available under the MIT license. You may use, modify, and distribute this component in personal and commercial projects.

Was this page helpful?

Your response helps us improve component docs.

Related components