0.0.9 • Published 11 months ago

tami-modal v0.0.9

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

tami-modal 라이브러리

NPM

This is a simple modal/bottomsheet library you can use in React.

How to install

npm

npm install tami-modal

yarn

yarn add tami-modal

How to use

import

import Modal from 'tami-modal';

Props

propsvaluemeaning
isOpentrue, falseboolean value for modal open/close
onCloseModalfunctionfunction for closing modal
modalLocationcenter, bottom (default: center)depends where the modal should locate

Example

import { useState } from 'react';
import Modal from 'tami-modal';

function App() {
  const [isOpen, setIsOpen] = useState(false);

  const openModal = () => {
    setIsOpen(true);
  };

  const closeModal = () => {
    setIsOpen(false);
  };

  return (
    <div className='App'>
      <button onClick={openModal}>open modal</button>
      <Modal isOpen={isOpen} onCloseModal={closeModal} modalLocation={'bottom'}>
        {/* Modal Contents that you want to pass it as a children */}
      </Modal>
    </div>
  );
}

export default App;

ezgif com-video-to-gif (1)

Contributor

Taeeun Kim
0.0.9

11 months ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago