1.0.8 • Published 2 years ago

@noucho/react-modal v1.0.8

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

@noucho/react-modal

Responsive modal dialog component for React.

Node version :

  • Node v16.0.0
  • npm v7.10.0

Installation

To install, you can use npm or yarn:

$ npm install @noucho/react-modal
$ yarn add @noucho/react-modal
  • Use <Modal> tag inside your React app.
import { Modal } from '@noucho/react-modal/dist'
import React from 'react'

export default function Form() {
  window.React = React

  const [isValid, setIsValid] = useState(false)
  
  const handleModalResponse = () => {
    setIsValid(false)
  }

  const handleAddFormSubmit = (e) => {
    e.preventDefault()
    setIsValid(true)
  }

  return (
    <section className="formContent">
      <h2 className="formTitle">Create Employee</h2>
      <form className="form" onSubmit={handleAddFormSubmit}>
        (...)
      </form>
      {isValid ? <Modal text="Employee Created !" handleResponse={handleModalResponse} /> : ''}
    </section>
  )
}
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

0.0.0

2 years ago