Hex Core JS
    Preparing search index...

    Function Modal

    • Modal component shows a pop-up that disables the rest of the application. Click on the background, click close button, or hit escape to close the modal. The open state of the Modal must be held in an ancestral component. Should be used with <Modal.Header>, <Modal.Body>, and <Modal.Footer> subcomponents for content layout.

      Parameters

      Returns ReactPortal

    Index

    Methods

    • Conditionally renders a Modal component and uses a transition animation. Only accepts a single child and that child should be a Modal component.

      Parameters

      Returns Element

    • Wraps useToggle and renames return values for convenience.

      Parameters

      Returns {
          closeModal: () => void;
          isModalOpen: boolean;
          openModal: () => void;
          setIsModalOpen: Dispatch<SetStateAction<boolean>>;
          toggleIsModalOpen: () => void;
      }