Command Palette

Search for a command to run...

Docs
Slide To Delete Button

Slide To Delete Button

A draggable button that confirms deletion when fully slid

Loading...

Installation

Props

PropTypeDefaultDescription
labelstring"Slide to Delete"The text displayed on the button
deletedLabelstring"Deleted"The text displayed after successful deletion
iconReactNode<Trash2 className="w-4 h-4" />The icon displayed in the drag handle
dragLimitnumber140The distance in pixels required to trigger deletion
classNamestring-Additional CSS classes for styling
onClickfunction-Function called when deletion is confirmed

Examples

Custom Colors

You can customize the button's appearance using the className prop:

<SlideToDeleteButton
  className="bg-yellow-100 text-yellow-700 hover:bg-yellow-200"
  label="Slide to Archive"
  deletedLabel="Archived"
/>

Custom Action

Use the onClick prop to handle the deletion action:

<SlideToDeleteButton
  label="Remove Item"
  onClick={() => handleItemRemoval(itemId)}
/>