1.0.6 • Published 2 years ago

hr-modal v1.0.6

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

react-modal-component-library

A React components created with template.

Installation

Run the following command: npm i hr-modal

Using

Import Modal component and the hook useModal. Props isShowing and toggle are required.

import Modal, { useModal } from 'hr-modal'

function App() {
  const { isShowing, toggle } = useModal()

  return (
    <div>
			{/* the triggering of the modal needs the toggle previously defined */}
      <button onClick={toggle}>Bouton</button>
			{/*here you insert the modal you need to display on triggered event */}
      <Modal isShowing={isShowing} hide={toggle} />
    </div>
  )
}

export default App

Setup for publish

  • npm run build
  • edit version in package.json
  • npm publish

Link

NPM

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago