JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q35035F

A customizable React modal component

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-simple-modal-by-vassili-langlois) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    React Simple Modal

    A customizable React modal component.

    Requirements

    • Node.js version 14.x or higher
    • npm (usually installed with Node.js)
    • Recommended code editor: Visual Studio Code

    Installation

    npm install react-simple-modal

    Usage

    import React from "react";
    import Modal from "@vassili/modal";
    import "@vassili/modal/dist/modal.css";
    
    function App() {
      const [open, setOpen] = React.useState(false);
    
      return (
        <>
          <button onClick={() => setOpen(true)}>Open Modal</button>
          <Modal isOpen={open} onClose={() => setOpen(false)}>
            <div>Your content here</div>
          </Modal>
        </>
      );
    }

    Props

    Prop Type Description
    isOpen boolean Show or hide the modal
    onClose function Callback when closing the modal
    children node Modal content

    License

    MIT