@hsl-fi/modal

0.3.2 • Public • Published

Modal

import Modal from '@hsl-fi/modal';

const [isModalOpen, setIsModalOpen] = useState(false);
const handleModalCrossClick = () => setIsModalOpen(false);

<Modal
  appElement="#__next"
  contentLabel="Content label"
  closeButtonLabel="Close"
  isOpen={isModalOpen}
  onCrossClick={handleModalCrossClick}
  // variant?: "large", "small" or "confirmation"
  // shouldCloseOnEsc?: boolean;
  // shouldCloseOnOverlayClick?: boolean;
  // onOpen?: () => void;
  // onClose?: () => void;
>
  <ChildComponent />
</Modal>

Readme

Keywords

none

Package Sidebar

Install

npm i @hsl-fi/modal

Weekly Downloads

16

Version

0.3.2

License

none

Unpacked Size

19.1 kB

Total Files

4

Last publish

Collaborators

  • anttionttonen
  • vmhonkala
  • ollinieminen
  • tafe-solita