Default
Installation
templui add dialog
Load the script once in your layout:
<head>
@dialog.Script()
</head>
Examples
External Trigger
Non-modal
API Reference
Required parameter
Hover for description
Dialog
Main dialog wrapper component. Provides context for child components.
| Name | Type | Default |
|---|---|---|
| | |
| | |
| | |
| | |
| | |
| | |
Trigger
Element that triggers the dialog to open. Usually used inside Dialog, or externally by targeting a dialog root ID with For.
| Name | Type | Default |
|---|---|---|
| | |
| | |
| | |
| | |
Content
Native dialog content rendered inside Dialog.
| Name | Type | Default |
|---|---|---|
| | |
| | |
| | |
| | |
Header
Header section of the dialog.
| Name | Type | Default |
|---|---|---|
| | |
| | |
| | |
Title
Dialog title component. Should be used inside Header.
| Name | Type | Default |
|---|---|---|
| | |
| | |
| | |
Description
Dialog description component. Should be used inside Header.
| Name | Type | Default |
|---|---|---|
| | |
| | |
| | |
Body
Body/content section of the dialog.
| Name | Type | Default |
|---|---|---|
| | |
| | |
| | |
Close
Element that closes the dialog.
| Name | Type | Default |
|---|---|---|
| | |
| | |
| | |
| | |
JavaScript API
// Open a dialog programmatically
window.tui.dialog.open("dialog-root-id");
// Close a dialog
window.tui.dialog.close("dialog-root-id");
// Toggle dialog state
window.tui.dialog.toggle("dialog-root-id");
// Check if dialog is open (returns true/false)
const isOpen = window.tui.dialog.isOpen("dialog-root-id");