1.1.5 • Published 11 months ago

react-modal-library-thomas-thivolet v1.1.5

Weekly downloads
-
License
MIT
Repository
-
Last release
11 months ago

modal-library

react modal library

NPM JavaScript Style Guide

Install

npm i react-modal-library-thomas-thivolet

Usage

In your App.jsx file

import React from "react"

import { Modal, useModal } from "react-modal-library-thomas-thivolet"

//Create your own component modal content
import MyComponentContent from " *your path* "

const App = () => {

  // Declare useModal hook
  const { isShowing, toggle } = useModal();

  return (
    <div>
      <button onClick={toggle}>Open Modal</button>
      <Modal element={<MyComponentContent />} isShowing={isShowing} toggle={toggle}/>
    </div>
  )
} 

MyComponentContent.jsx file

import React from "react"

const MyComponentContent = () => {
  return(
    <div>
      My modal content
    </div>
  )
}

export default MyComponentContent

.

1.1.1

12 months ago

1.1.0

12 months ago

1.0.10

12 months ago

1.0.20

12 months ago

1.0.30

12 months ago

1.1.5

11 months ago

1.1.4

11 months ago

1.1.3

11 months ago

1.1.2

12 months ago

1.0.9

1 year ago