0.1.6 • Published 7 months ago
modal-nextjs v0.1.6
Simple Modal component created for Next.js projects
A modal component built with Next.js using FontAwesome
Installation
npm i modal-nextjs
Or :
yarn add modal-nextjs
Or :
pnpm add modal-nextjs
Example of use
import { Modal } from 'modal-nextjs'
import { useState } from 'react'
const Example = () => {
const [modalIsOpen, setModalIsOpen] = useState(false)
const handleclick = () => {
setModalIsOpen(true)
}
return (
<main>
<h1>Hello world</h1>
<button onClick={handleclick}>Click to open modal</button>
{modalIsOpen && (
<Modal
setModalIsOpen={setModalIsOpen}
content={
<div>
<p className="p-class-example">Modal is open !</p>
</div>
}
/>
)}
</main>
)
}
export default Example
props:
setModalIsOpen
: This state function is mandatory and will allow the modal to close itself | Required
content
: The React content (HTML/css) to display in the modal
| Required
Additional informations:
Author : Pierre-Yves Léglise
0.1.6
7 months ago
0.1.5
7 months ago
0.1.5-15
7 months ago
0.1.5-14
7 months ago
0.1.5-13
7 months ago
0.1.5-12
7 months ago
0.1.5-11
7 months ago
0.1.5-10
7 months ago
0.1.5-9
7 months ago
0.1.5-8
7 months ago
0.1.5-7
7 months ago
0.1.5-6
7 months ago
0.1.5-5
7 months ago
0.1.5-4
7 months ago
0.1.5-3
7 months ago
0.1.5-2
7 months ago
0.1.5-1
7 months ago
0.1.4-1
7 months ago
0.1.4
7 months ago
0.1.3
7 months ago
0.1.2
7 months ago
0.1.1-3
7 months ago
0.1.1-2
7 months ago
0.1.1-1
7 months ago
0.1.1
7 months ago
0.1.0
7 months ago
0.1.0-4
7 months ago
0.1.0-3
7 months ago
0.1.0-2
7 months ago
0.1.0-1
7 months ago
0.1.0-0
7 months ago