0.1.6 • Published 2 years 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
2 years ago
0.1.5
2 years ago
0.1.5-15
2 years ago
0.1.5-14
2 years ago
0.1.5-13
2 years ago
0.1.5-12
2 years ago
0.1.5-11
2 years ago
0.1.5-10
2 years ago
0.1.5-9
2 years ago
0.1.5-8
2 years ago
0.1.5-7
2 years ago
0.1.5-6
2 years ago
0.1.5-5
2 years ago
0.1.5-4
2 years ago
0.1.5-3
2 years ago
0.1.5-2
2 years ago
0.1.5-1
2 years ago
0.1.4-1
2 years ago
0.1.4
2 years ago
0.1.3
2 years ago
0.1.2
2 years ago
0.1.1-3
2 years ago
0.1.1-2
2 years ago
0.1.1-1
2 years ago
0.1.1
2 years ago
0.1.0
2 years ago
0.1.0-4
2 years ago
0.1.0-3
2 years ago
0.1.0-2
2 years ago
0.1.0-1
2 years ago
0.1.0-0
2 years ago