@quentinm22/modal-cmp-react
v1.0.1
Published
PACKAGE npm-modal-react-cmp
Downloads
12
Readme
@quentinm22/npm-modal-react-cmp
PACKAGE npm-modal-react-cmp
Installation
Install Package in React project
npm i @quentinm22/modal-cmp-react
yarn add @quentinm22/modal-cmp-react
Update
npm i @quentinm22/modal-cmp-reactp@latest
yarn add @quentinm22/modal-cmp-react@latest
Usage/Examples
import{ Modal } from "@quentinm22/npm-modal-react-cmp"
function App() {
const [toggle, setToggle] = useState(false)
const bgColor = ["10", "61", "97", "0.5"]
return (
<>
<button onClick={() => setToggle(true)}>ShowModal</button>
<Modal
toggle={toggle}
onClose={() => setToggle(false)}
backgroundColor={bgColor}
border="#60a3bc"
title="test"
content="Lorem ipsum dolor sit amet, consectetur adipisicing elit. Rem repellat nesciunt a? Beatae dolore adipisci minima rem, quibusdam omnis officiis accusamus eius illo distinctio, perferendis in perspiciatis voluptatem natus quis."
/>
</>
)
}
| Props | Value | | ------------- | ------------- | | toggle | bool | | onClose | function => setState(false) | | backgroundColor | array => ["r","g","b","a"] | | border | string => color hexa | | width | number | | title | string | | content | string |