Skip to content

Modal

The modal component.

  • Import
    import "@tapsioss/web-components/modal";
  • Tag
    <tapsi-modal></tapsi-modal>

Properties

NameDescriptionTypeDefault Value
openIndicates whether the modal is open or not.booleanfalse
headingSets the title of the modal.string""
descriptionSets the description text for the modal.string""
alignmentDetermines the alignment of the modal's content."start" | "center""start"

Slots

NameDescription
imageryThe slot for imagery element.
action-barThe slot for actionbar element.

TIP

You can use slot names as variables:

ts
import { Slots } from "@tapsioss/web-components/modal";

console.log(Slots.IMAGERY); // "imagery"
console.log(Slots.ACTION_BAR); // "action-bar"

Events

NameDescriptionType
showFires when the modal should be visible. (Cancelable)ShowEvent
hideFires when the modal should be hidden. (Cancelable)HideEvent

TIP

You can import custom event names:

ts
import { 
  ShowEvent,
  HideEvent
} from "@tapsioss/web-components/modal";

element.addEventListener(ShowEvent.type, handleTapsiModalShow);
element.addEventListener(HideEvent.type, handleTapsiModalHide);