2.1.0 • Published 2 years ago

@tim-jn/react-modal v2.1.0

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

@Tim-jn/react-modal

Responsive modal dialog component for React.

Installation

To install, you can use npm or yarn:

$ npm install @tim-jn/react-modal
$ yarn add @tim-jn/react-modal
  • Use <Modal> tag inside your React app.

Exemple

import { Modal } from '@tim-jn/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>
  )
}
2.1.0

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

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

0.1.0

2 years ago