Skip to content

Modal API

API reference docs for the Stash Modal component. Learn about the props, CSS, and other APIs of this exported module.

Import

ts
import Modal from '@leaflink/stash/Modal.vue';

Props

NameTypeDefaultDescription
closeButtonColorClassstring 'tw-text-white/50' Add classes to the close button. This can be used with the hideHeader prop and featuredContent slot to accommodate images with different color backgrounds.
contrastbooleanfalseGives the modal body have a light gray background
disableBodyPaddingboolean-Disables the default padding in the modal body.
hideClosebooleanfalseHides the "close" button
hideHeaderbooleanfalseHide the header. Typically used with the featuredContent slot to display a graphic and create a "promo" modal.
isOpenbooleanfalseOpens the modal when truthy; hides the modal when falsy.
modelValuebooleanfalseUse v-model:is-open or :is-open instead of :model-value and v-model.
openbooleanfalseOpens the modal when truthy; hides the modal when falsy.
positionModalPositionscenterThe position on the screen to display the modal.
preventDismissbooleanfalsePrevents the modal from being dismissed by clicking the backdrop or pressing the escape key. Example: There are in-flight api requests and you do not want the modal to close until they are done.
scrollablebooleanfalseShould the modal be scrollable within the content area. This prop is treated as `true` when the `position` prop is set to "left" or "right".
sizeModalSizesmediumSets a preset max-width on the modal. Options: default (648px), narrow (360px), wide (960px)
titlestring '' Text to display in the modal header

Slots

NameDescription
headerActionAdds an action to the left side of the header bar. An example usage is a modal with multiple pages and a back button can be inserted here
default
Overrides the whole footer section. Used for rendering custom footers with more than 2 actions. If defined, "actions" slot will get ignored.
actionsModal footer actions, supports rendering up to 2 `<Button>` children

Events

NameDescription
update:open
update:is-open
dismiss