rc-unmodal
TypeScript icon, indicating that this package has built-in type declarations

1.0.8 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i rc-unmodal

Weekly Downloads

2

Version

1.0.8

License

MIT

Unpacked Size

156 kB

Total Files

51

Last publish

Collaborators

  • hunghg255