1.0.9 • Published 2 years ago

react-modal-library-rayan-dahmena v1.0.9

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

modal-library

react modal library

NPM JavaScript Style Guide

Install

npm i react-modal-library-rayan-dahmena

Usage

In your App.jsx file

import React from "react"

import { Modal, useModal } from "react-modal-library-rayan-dahmena"

//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

License

MIT © rayanadir

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

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.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago