rc-unmodal
v1.0.8
Published
A react component unified modal
Downloads
22
Readme
Live demo
Installation
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
Gia Hung – hung.hg