React Swipe To Delete Component screenshot

React Swipe To Delete Component

Author Avatar Theme by Gaer87
Updated: 12 Oct 2025
72 Stars

A simple React component implement 'swipe to delete' UI-pattern.

Categories

Overview

The React-swipe-to-delete-component is a convenient and straightforward tool designed to enhance user interactions within React applications. It introduces an intuitive swipe gesture that allows users to easily delete items, aligning well with modern mobile and web design patterns. This component aims to simplify the user experience by integrating a familiar ‘swipe to delete’ functionality that improves efficiency and usability.

With its customizable features and simple implementation via npm, developers can quickly incorporate this component into their projects. The ability to hook into various events and customize styles makes it a flexible choice for enhancing any application that requires item deletion capabilities.

Features

  • Simple Implementation: Easily integrate the swipe-to-delete functionality into your React components with minimal setup.

  • Customizable Tag: Set the root element’s tag for the component with the tag property, defaulting to “div” for easy customization.

  • Background Decoration: Control the visual aspect with an optional background property that adds a decorative element beneath the content.

  • Swipe Threshold: Adjust the deleteSwipe property to determine the swipe percentage required before a deletion animation initiates, with a default value of 0.5.

  • Event Callbacks: Utilize the onDelete and onCancel functions to execute custom logic when an item is deleted or when a swipe gesture is canceled.

  • Directional Swipe Handlers: Implement onRight and onLeft functions to handle different swipe directions, adding further interactivity.

  • CSS Transitions: Smooth animations are automatically handled using CSS3 transitions, providing a polished experience for users.

  • MIT License: The project is open-source and encourages contributions, allowing for further enhancements and feature requests from the community.