JSPM

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

A reusable Modal component to display messages or notifications in React web applications. Easy to integrate and customizable according to the needs of the project.

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-ball-modal) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    React Ball Modal

    A simple React modal component with a ball design.

    Description

    React Ball Modal is a lightweight and customizable modal component for React applications.

    Installation

    You can install react-ball-modal via npm:

    npm install react-ball-modal
    
    Usage
    
    import { useState } from 'react'
    import Modal from 'react-ball-modal'
    
    function App() {
      const [isModalOpen, setIsModalOpen] = useState(false)
    
      const handleOpenModal = () => {
        setIsModalOpen(true)
      }
    
      const handleCloseModal = () => {
        setIsModalOpen(false)
      }
    
      return (
        <main>
          <h1 className='mainTitle'>Ball Modal</h1>
          <button className='button' onClick={handleOpenModal}>Open Modal</button>
          <Modal isOpen={isModalOpen} onClose={handleCloseModal} message="Choose your content !" />
        </main>
      )
    }
    
    export default App
    
    Props
    
    - `isOpen` (boolean, required): Controls whether the modal is open or closed.
    - `onClose` (function, required): Callback function to handle closing the modal.
    - `message` (string): Message to display inside the modal.
    
    Prerequisites
    
    Before using this modal component, make sure you have the following dependency installed:
    
    - [React](https://reactjs.org/)
    
    License
    This project is licensed under the MIT License - see the LICENSE.md file for details.