2.0.11 • Published 1 year ago

rpic-modal v2.0.11

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

rpic-modal

What is it?

This is just a react modal customizable by props

Install

npm i rpic-modal

Usage

After installing the package, go to the parent component of your modal and import useState

import { useState } from 'react';

Then use a state to show / hide you modal, some App code exemple:

import { useState } from 'react';
import RpicModal from './components/RpicModal';

function App() {
    const [showModal, setShowModal] = useState(false);

    return (
        <div className="App">
            <div onClick={() => setShowModal(!showModal)}>Show the modal</div>
            {showModal && (
                <RpicModal
                    content="Customizable content"
                    closeModal={() => setShowModal(!showModal)}
                />
            )}
        </div>
    );
}

Props

PropNameTypeExemple
contentstring'This is a content exemple'
widthstring'50px'
heightstring'50%'
backgroundColorstring'red'
borderstring'2px solid black'
borderRadiusstring'10px'
justifyContentstring'start', 'end', center'
alignItemsstring'start', 'end', center'
iconSizestring'30px'
closeModalfunction() => { console.log('close')}

License

MIT

2.0.11

1 year ago

2.0.10

1 year ago

2.0.9

1 year ago

2.0.8

1 year ago

2.0.7

1 year ago

2.0.6

1 year ago

2.0.5

1 year ago

2.0.4

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.0.0

1 year ago