Skip to content

A React Component To Use Modal Like Bootstrap Intelligently

Notifications You must be signed in to change notification settings

jaysonwu991/react-modal

Repository files navigation

react-modal

A React Component To Use Modal Like Bootstrap Intelligently

Background

Bootstrap Modal is beautiful, it is still attractive to be used by React, Modal is displayed in the center of the browser window,it uses margin-top to make it center instead of flex box (CSS3), so it is also fit for the browser of lower versions.

Installation

$ npm i -S @jayson991/react-modal

Usage With React

import React from 'react'
import Modal from '@jayson991/react-modal'

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

  return (
    <div className='App'>
      <span onClick={() => setShowModal(true)}>Click Me!</span>
      <Modal
        title='Hello'
        showModal={showModal}
        onHideModal={() => setShowModal(false)}
      >
        <h1>Hello World!</h1>
      </Modal>
    </div>
  )
}

export default App

About

A React Component To Use Modal Like Bootstrap Intelligently

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published