Diwa Design System

Modal

An overlay dialog that focuses the user's attention on a single task or piece of information. The page behind is blocked from interaction until the modal is dismissed.

Properties

NameTypeDefaultDescription
openbooleanfalseWhether the modal is open. Controlled prop — the consumer must manage this value.
headingstringundefinedHeading text shown in the title bar. Used as the accessible name via aria-labelledby.
dismissButtonbooleantrueWhen false, the × dismiss button is hidden. Ensure another close action is available.
disableBackdropClickbooleanfalseWhen true, clicking the backdrop does not emit dismiss. Use for required confirmations.
backdrop'blur' | 'shading''blur'Visual style of the backdrop. blur = frosted glass; shading = solid dark scrim.
theme'dark' | 'light''dark'Per-component theme override. Reflects data-theme on the host, propagating token cascade into the shadow DOM.

Events

NameDetail typeBubblesDescription
dismissvoidNoEmitted when the user requests the modal to close — via backdrop click (unless disableBackdropClick), Escape key, or the × dismiss button. The consumer must set open={false} in response.

Slots

NameDescription
defaultScrollable body content. Accepts any HTML, form elements, or components.
headerOptional sub-header section rendered below the title bar (e.g. a description, metadata line). Hidden when empty.
footerSticky footer section for action buttons. Rendered with a top border. Hidden when empty.

CSS custom properties

PropertyDefaultDescription
--diwa-modal-width560pxWidth of the modal panel. Override per-instance to create narrow (confirm) or wide (data) modals.
--diwa-modal-max-height85vhMaximum height of the modal panel. The body scrolls beyond this height.

Inherited design tokens

The following global tokens from app.css are consumed by the modal. Override them on :root or a parent element to adjust the appearance globally.

TokenRole
--diwa-bg-surfacePanel and header/footer background
--diwa-bg-frostedBackdrop background (blur mode)
--diwa-bg-shadingBackdrop background (shading mode)
--diwa-borderPanel border and internal dividers
--diwa-shadow-xlPanel drop shadow
--diwa-radius-xlPanel border radius
--diwa-z-modalz-index of the modal host (default: 1000)
--diwa-blur-lgBlur intensity of the frosted backdrop
--diwa-border-focusFocus ring color on the dismiss button