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
| Prop | Type | Default | Description |
|---|---|---|---|
| onDelete | () => void | - | Callback function to execute when the button is successfully held for the specified time. |
| holdTime | number | 2000 | Duration in milliseconds to hold the button before triggering the delete action. |
| className | string | '' | Additional CSS classes to apply to the button. |
| ...props | React.ButtonHTMLAttributes<HTMLButtonElement> | - | Standard button attributes. |