v0.0.14
components

Dialog

A customizable dialog component for displaying modal content on a page, typically used for alerts, confirmations, or custom forms.

API Reference

DialogProps

Extends all the standard HTML attributes of the `<div>` element.

PropertyTypeDefaultDescription
ref $bindable
HTMLDivElement
Reference to the rendered DOM element.
isOpen $bindable
boolean
falseManage/listen open state
onClose
function
Callback when dialog is closed
layout
union
"fixed"Manage dialog layout
- 'fixed' => Centered in viewport, overflow hidden
- 'scroll' => Scrollable vertically, useful for tall content
- 'fullscreen' => Fills the entire viewport (100vw × 100vh)
closeOnBackdropClick
boolean
trueClose dialog on backdrop click
closeOnEscape
boolean
trueClose dialog on escape key
focusTrap
boolean
trueTrap focus inside dialog content
lockScroll
boolean
trueLock body scroll when open
blurBackdrop
boolean
falseApply blur effect to the backdrop
keepMounted
boolean
falseKeep dialog in the DOM when closed instead of unmounting it
transitionDelay
number
0Transition delay of open/close animation
transitionDuration
number
250Transition duration of open/close animation
children
Snippet
Dialog content to render

Examples

Layout fixed (default)

Centered content in viewport, overflow hidden

Layout scroll

Scrollable vertically, useful for tall content

Layout fullscreen

Fills the entire viewport (100vw × 100vh)

Keep mounted

Keep dialog in the DOM when closed instead of unmounting it

Alert dialog