1.0.5 • Published 1 year ago

react-modal-emmanuellets v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

react-modal-emmanuellets

react simple modal

NPM JavaScript Style Guide

Install

npm install --save react-modal-emmanuellets

Usage

import React from 'react'
import Modal from 'react-modal-emmanuellets'

type AppProps = {
  className: string
  btnTexte: string
}

const Exemple = ({ className, btnTexte }: AppProps) => {
  const [showModal, setShowModal] = useState(false)
  const hideModal = () => showModal && setShowModal(false)
  return (
    <div className={className}>
      <button
        style={btnStyles}
        className={className}
        onClick={() => setShowModal(true)}
      >
        {btnTexte}
      </button>
      <Modal show={showModal} onClickCloseBtn={hideModal}>
        Texte exemple!
      </Modal>
    </div>
  )
}

##API

NameTypeDefaultDescription
showbooleanfalseOpens the modal.
onClickCloseBtnReact.MouseEventHandlerfalse voidClose the modal.

License

MIT © neverswood

1.0.5

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago