Skip to content

azabraao/react-swipe-to-close-modal

Repository files navigation

React Swipe To Close Modal

A React Modal component that closes on swipe touch ✨

Demo

Installation

npm install react-swipe-to-close-modal

Usage

import Modal from "react-swipe-to-close-modal";

const NiceComponent = () => {
  const [isOpen, setIsOpen] = useState(false);

  const close = () => setIsOpen(false);

  return (
    <Modal isOpen={isOpen} close={close}>
      // your UI code here
    </Modal>
  );
};