modal-kayvon

0.1.4 • Public • Published

modal-kayvon

This project was bootstrapped with Create React App.

Note

Modal dialogs

Install

npm install modal-kayvon
or
yarn add modal-kayvon

Usage

import React, { useState } from 'react';
import { Modal } from 'modal-kayvon';


export default function Example(){
    
    const [isModalOpen, setIsmodalOpen] = useState(false)

    function openModal(){
        setIsmodalOpen(true)
    }

    function closeModal(){
        setIsmodalOpen(false)
    }
    
    return(
        <div>
            <button onClick={openModal}> Open </button>
            {isModalOpen && (
                closeModal={closeModal}
                messageModal='Congratulations!'
            )}
        </div>
    )
}

Package Sidebar

Install

npm i modal-kayvon

Weekly Downloads

5

Version

0.1.4

License

none

Unpacked Size

4.88 kB

Total Files

5

Last publish

Collaborators

  • kayv