The Dialog component is a modal window based on the native HTML element <dialog>. Thanks to this foundation, it benefits from accessible and semantic features by default, such as focus management, closing with the Escape key or clicking outside the box (unless persistent is enabled).
It can be used to display temporary content above the main interface: messages, forms, confirmations, etc. It is controlled via the prop bindable open, can be customized in position, size, density and style, and adapts easily to all usage contexts.
Examples of dialog
Base
Displays a simple dialog with central content. This is the basic use case for displaying a message or a quick interaction.
Size
Show how to adjust the size of the Dialog with prop size. You can choose between xs, sm, md, lg and xl to adapt the available space to the content.
Density
Allows you to modify the internal density (padding) of the content, with the values compact, comfortable or default. Perfect for adjusting the overall feel of the component
Position
Change the Dialog’s vertical alignment on the screen (top, center, bottom) to suit your design or the context in which it appears.
Persistent
Makes the Dialog persistent: it no longer closes automatically on clicking outside or on Escape. Very useful to avoid accidental closing during critical actions or long forms.
API Reference
props
type
description
default
type_extend
ref $bindable
HTMLElement
Direct access to DOM element
undefined
is
enum
Makes the component <a> or <button> or div.
div
button | a | div
open $bindable
boolean
Controls component opening/closing
false
dark
boolean
Enable dark theme for component.
false
light
boolean
Enable light theme for the component.
false
color
string
Applies a custom color to text or icons.
undefined
background
string
Apply a custom background color.
undefined
density
enum
Controls vertical density
default
compact | comfortable | default
rounded
string
Controls item rounding (none, sm, md, lg, etc.).
md
variant
enum
Sets the visual style of the Card.
filled
outline | text | filled
classContent
string | string[]
Add custom classes to the wrapper
undefined
size
enum | {enum: enum}
Set Chip size: xs, sm, md, lg, xl or full.
md
xs | sm | md | lg | xl | full
persistent
boolean
Prevent closing by clicking outside or with Escape.
false
position
enum
Vertical position of content on screen
center
bottom | center | top
Variables CSS
variable
default
description
–-dialog-color
–-kit-on-container
Text color
–-dialog-background
–-kit-container
Background color
–-dialog-radius
--kit-radius-md
Dialog edge radius
Remember to follow up with Modal or Popover to create complete user paths.