Skip to content

EMessageBox Message box ​

import EUI 1.0

Examples ​

Message box ​

QML sourceQML
Preview
Run the code to try the component

Edit text, properties, or events, then select Run.

Code runs in this browser Licenses

Properties ​

PropertyDescriptionValues and default
alignCenterbool

Center the layout or text.

DefaultInherited; default true
autofocusbool

Focus automatically when shown, subject to availability and popup lifecycle.

Defaulttrue
backgroundColorcolor

Background color.

DefaultDynamic binding
beforeClosevar

Callback before closing; dialogs complete asynchronous checks through done(cancel).

Defaultfunction(action, instance, done) { done() }
borderColorcolor

Border color.

DefaultDynamic binding
buttonSizeint

Size of the action buttons.

EStyle.Small
EStyle.Medium
EStyle.Large

DefaultEStyle.Medium
callbackvar

Message-box result callback receiving action type and input value.

Defaultnull
cancelButtonLoadingbool

Show loading state on the cancel or confirm button.

Defaultfalse
cancelButtonLoadingIconint

Icon used by the component.

EIcons.*
0 (no icon)

Default0
cancelStyleTypeint

Semantic color style.

EStyle.Default
EStyle.Primary
EStyle.Success
EStyle.Info
EStyle.Warning
EStyle.Danger

DefaultEStyle.Default
cancelTextstring

Cancel button text.

DefaultLocalized text
centerbool

Center the layout or text.

Defaultfalse
closeDelayint

Delay, throttling or automatic close time in milliseconds; 0 means no delay or no timed close.

Default0
closeIconint

Icon used by the component.

EIcons.*
0 (no icon)

DefaultEIcons.XMARK
closeOnClickOutsidebool

Close when clicking outside the popup.

Defaulttrue
closeOnEscapebool

Allow Escape to close the component.

Defaulttrue
closePolicyenum

Automatic popup closing conditions; flags can be combined.

Popup.* (combine with |)
NoAutoClose
CloseOnPressOutside
CloseOnPressOutsideParent
CloseOnReleaseOutside
CloseOnReleaseOutsideParent
CloseOnEscape

DefaultDynamic binding
confirmButtonLoadingbool

Show loading state on the cancel or confirm button.

Defaultfalse
confirmButtonLoadingIconint

Icon used by the component.

EIcons.*
0 (no icon)

Default0
confirmStyleTypeint

Semantic color style.

EStyle.Default
EStyle.Primary
EStyle.Success
EStyle.Info
EStyle.Warning
EStyle.Danger

DefaultEStyle.Primary
confirmTextstring

Confirm button text.

DefaultLocalized text
contentalias

Content slot; declare QML child objects directly inside the component.

DefaultAlias: dialogContent.data
contentComponentComponent

Component slot for custom body content; null uses the default content. See this page’s examples for delegate context.

Defaultnull
dangerouslyUseHTMLStringbool

Interpret content as rich text; enable only for trusted content.

Defaultfalse
destroyOnClosebool

Destroy Component-loaded content after closing.

Defaultfalse
dialogRadiusreal

Corner radius in pixels.

Default8
distinguishCancelAndClosebool

Distinguish cancellation from other close actions.

Defaultfalse
draggablebool

Enable dragging of the object defined by the current component.

DefaultInherited; default false
enabledbool

Allow interaction; false disables the control.

Defaulttrue
enterDurationint

Animation or display duration in milliseconds; the component binding identifies its use.

Default220
exitDurationint

Animation or display duration in milliseconds; the component binding identifies its use.

Default180
focusbool

Whether the popup requests focus.

Defaultautofocus
fullscreenbool

Use full-screen display or a full-window overlay.

Defaultfalse
heightreal

Component size in pixels; may be bound to its parent layout.

Defaultfullscreen && Overlay.overlay ? Overlay.overlay.height : implicitHeight
iconSourceint

Icon used by the component.

EIcons.*
0 (no icon)

Default0
inputErrorMessagestring

Message shown for invalid message-box input.

Default""
inputPatternvar

Regular expression validating message-box input.

Defaultnull
inputPlaceholderstring

Placeholder shown when the value is empty.

Default""
inputTypestring

Input type in the message box.

"text" / "textarea"
"password" / "number"
"email" / "tel"
"url"

Default"text"
inputValidatorvar

Custom message-box input validator returning a boolean or error text.

Defaultnull
inputValuestring

Current message-box input value.

Default""
modalbool

Use a modal popup that blocks interaction with underlying content.

Defaulttrue
modalOverlayColorcolor

Modal or non-modal overlay color.

DefaultDynamic binding
modalPenetrablebool

Allow input to pass through the non-modal overlay.

Defaultfalse
modelessOverlayColorcolor

Modal or non-modal overlay color.

DefaultDynamic binding
openDelayint

Delay, throttling or automatic close time in milliseconds; 0 means no delay or no timed close.

Default0
overflowbool

Allow the dialog to be dragged beyond the window bounds.

DefaultInherited; default false
roundButtonbool

Use rounded pill button styling.

Defaultfalse
showCancelButtonbool

Show the cancel button.

Defaulttrue
showClosebool

Show a close or remove button.

Defaulttrue
showConfirmButtonbool

Show the confirm button.

Defaulttrue
showFooterbool

Show the footer action area.

Defaulttrue
showHeaderbool

Show the header area.

Defaulttrue
showInputbool

Show numeric input or the message-box input area.

Defaultfalse
styleTypeint

Semantic color style.

EStyle.Default
EStyle.Primary
EStyle.Success
EStyle.Info
EStyle.Warning
EStyle.Danger

DefaultEStyle.Default
textstring

Displayed text.

Default""
textColorcolor

Text color.

DefaultDynamic binding
titlestring

Title text.

Default""
titleColorcolor

Title color.

DefaultDynamic binding
topreal

Dialog top position in pixels, used when not vertically centered.

Default0
visiblebool

Whether the component is visible.

Defaulttrue
widthreal

Component size in pixels; may be bound to its parent layout.

DefaultDynamic binding
windowMarginreal

Minimum dialog margin from the window edges in pixels.

Default16
loadedContentaliasRead only

Actual content item instantiated from a Component.

DefaultAlias: contentLoader.item
loadedMessageContentaliasRead only

Actual content item instantiated from a Component.

DefaultAlias: messageContentLoader.item
maximumDialogWidthrealRead only

Maximum dialog width after subtracting window margins.

DefaultComputed at runtime

Signals ​

SignaturePurpose
closeRejected()

Emitted when beforeClose rejects a close request.

openAutoFocused()

Emitted after the popup opens and finishes focusing its content.

closeAutoFocused()

Emitted after the popup closes and restores focus.

canceled()

Emitted when the current operation is cancelled.

confirmed(string value)

Emitted on confirmation; value, when present, is the confirmed value.

completed(string action, string value)

Emitted when the message box finishes; action is the closing action and value is the input text.

Methods ​

SignaturePurpose
close()

Close the component panel or popup.

open()

Open the component panel or popup.

resetPosition()

Restore the dialog to its initial position.

requestClose()

Request popup closure and run the beforeClose check.

reject()

Cancel the current confirmation.

accept()

Confirm the current action; invalid input is not submitted.

alert(message, heading)

Show an alert message box with message and heading.

confirm(message, heading)

Show a confirmation message box with message and heading.

prompt(message, heading, initialValue)

Show a prompt with message, heading, and initialValue.

Released under the MIT License. Third-party assets retain their own licenses.