Docs / Components / Delete Button

Delete Button

A button that requires the user to hold it for a specified duration to trigger a delete action, preventing accidental deletions.

Dependencies

Install the following dependencies to use this component:

1npm install motion

Installation

Run the following command in your terminal to add the component to your project:

1npx rankflow-ui@latest add delete-button

Props Reference

PropTypeDefaultDescription
onDelete() => void-Callback function to execute when the button is successfully held for the specified time.
holdTimenumber2000Duration in milliseconds to hold the button before triggering the delete action.
classNamestring''Additional CSS classes to apply to the button.
...propsReact.ButtonHTMLAttributes<HTMLButtonElement>-Standard button attributes.