Docs
Modal

Modal

A window overlaid on either the primary window or another dialog window, rendering the content underneath inert. This modal is not disruptive, clicking anywhere outside the modal will close the modal.

Usage

Example Code

1import {
2  Modal,
3  ModalCloser,
4  ModalContent,
5  ModalTitle,
6  ModalTrigger,
7} from "inc-design-system/modal";

Example Code

1<Modal>
2  <ModalTrigger>
3    <Button>Open Modal</Button>
4  </ModalTrigger>
5  <ModalContent closable>
6    <ModalTitle status="info" description="This is some description">
7      Title
8    </ModalTitle>
9    <div className="text-text-default">Content</div>
10    <ModalCloser className="mt-4">
11      <Button variant="primary">Confirm</Button>
12    </ModalCloser>
13  </ModalContent>
14</Modal>

Props

Modal

For more props:

PropTypeDescriptionDefault
childrenReact.ReactNodeMust include ModalTrigger and ModalContent for the modal to work correctly.-

ModalTrigger

For more props:

PropTypeDescriptionDefault
childrenReact.ReactNodeWhen clicked on, opens up the ModalContent.-

ModalContent

PropTypeDescriptionDefault
childrenReact.ReactNodeCustomizable content to display in the modal.-
classNamestringOptional. Extra Tailwind styles for the overall modal content.-
overlayClassNamestringOptional. Extra Tailwind styles for the Modal overlay.-
closablebooleanOptional. Shows an 'X' at the opposite end of the title to close the modal.-

ModalTitle

PropTypeDescriptionDefault
childrenReact.ReactNodeContent to be displayed as the title.-
status"success" | "error" | "warning" | "info"Optional. Shows predefined icons for the chosen status, positioned next to the title.-
descriptionstringOptional. Shown as small slightly greyed out words below the title.-
classNamestringOptional. Additional classNames to customize the title.-

ModalCloser

For more props:

PropTypeDescriptionDefault
childrenReact.ReactNodeWhen clicked on, closes the ModalContent.-
classNamestringOptional. Extra styling for the interactable element.-