dialog() renders a trigger button that opens an accessible Radix modal dialog containing any child components—forms, alerts, or detail views. Click the button below to test it live.
dialog()
<ComponentPreview title="Interactive Modal Dialog (click to open)">
{
"type": "dialog",
"title": "Confirm Session Reset",
"description": "This clears the current conversation memory and starts a fresh context window.",
"trigger_label": "Open Confirmation Dialog",
"children": [
{"type": "alert", "variant": "warning", "message": "Unsaved draft messages in this session will be removed."},
{"type": "button_group", "buttons": [{"label": "Confirm Reset", "action": "reset_session", "variant": "destructive"}]}
]
}
</ComponentPreview>
<Tabs>
<Tab title="Python">
</Tab>
<Tab title="YAML">
</Tabs>
| Parameter | Type | Description |
|---|---|---|
| title, description | str | Modal heading and explanatory subtitle. |
title
description
str
| trigger_label, variant | str | Trigger button text and button variant. |
trigger_label
variant
| children | list | Any child UI components rendered inside the modal body. |
children
list