Modal

Modal root: anchor id, open/close behavior, animation, and (in editor) remaining props pass through to Container.

Required Props: idSupports Children: any

Structure

All styling goes in props.className as a single Tailwind utility string. Non-class props (text, src, alt, etc.) stay on their own keys. root.animation for scroll effects.

Properties

PropertyTypeDescriptionExamples
anchorstring
Hidden anchor id; must match Button/Text click.value to open
Default: "my-modal"
-
viewstring
| preview
Editor: use preview to simulate viewer overlay
-
triggerobject
Auto-open behavior on published site
-
closeOnBackdropboolean
Click outside panel closes modal
Default: true
-
closeOnEscapeboolean
Escape key closes modal
Default: true
-
showCloseButtonboolean
-
Default: true
-
closeButtonPositionstring
top-right | top-left
-
Default: "top-right"
-
modalAnimationstring
fade | slide-up | slide-down | scale | none
-
Default: "fade"
-
modalWidthstring
Tailwind max-width class on dialog panel
Default: "max-w-lg"
-
modalPositionstring
center | top | bottom
-
Default: "center"
-
backdropBlurboolean
Backdrop blur in viewer
Default: false
-
canDeleteboolean
-
Default: true
-
canEditNameboolean
-
Default: true
-
customobject
-
-
classNamestring
Tailwind utility classes string. Mobile-first: unprefixed = base, md: = 768px+, sm: = 640px+, lg: = 1024px+. Includes layout, spacing, surface design, and typography.
flex flex-col gap-space-sm py-space-lg px-container-x md:flex-rowbg-primary text-primary-content rounded-box py-3.5 px-6 font-semibold
typestring
Editor wraps children in Container with type container
-
rootobject
Editor-only container chrome around children
-