1.0.2 • Published 8 months ago

react-modal-babi v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

react-modal

Made with create-react-library

NPM JavaScript Style Guide

Install

npm i react-modal-babi

Usage

import React, { useState } from 'react';
import Modal from 'react-modal-babi';

function App() {
  const [showModal, setShowModal] = useState(false);

  const openModal = () => {
    setShowModal(true);
  };

  const closeModal = () => {
    setShowModal(false);
  };

  return (
    <div>
      <button onClick={openModal}>Open Modal</button>
      <Modal show={showModal} onClickCloseBtn={closeModal}>
        <h1>Hello, I'm a modal!</h1>
        <p>This is some modal content.</p>
      </Modal>
    </div>
  );
}

export default App;

License

MIT © blayres

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago