Skip to content

Latest commit

 

History

History
69 lines (53 loc) · 2.33 KB

README.md

File metadata and controls

69 lines (53 loc) · 2.33 KB

logo

A react component unified modal ✨

NPM Version NPM Downloads Minizip Contributors License

Live demo

Live Demo

Installation

NPM

Install

npm i rc-unmodal@latest

Use

import { Modal, MotionModalStackContainer } from 'rc-unmodal';

const BasicModal = () => {
  const [open, setOpen] = useState(false);

  return (
    <>
      <button
        onClick={() => {
          setOpen(true);
        }}
      >
        Open Modal
      </button>
      <Modal title="A declaratively modal" open={open} onOpenChange={setOpen}>
        <p>This is a modal. You can put anything you want in here. And It can be nested.</p>
      </Modal>
    </>
  );
};

const App = () => {
  return (
    <MotionModalStackContainer clickOutsideToDismiss={true} responsive>
      <BasicModal />
    </MotionModalStackContainer>
  );
};

About

Buy Me A Coffee

Gia Hung – hung.hg