Skip to content

Dialog

A modal window on a dimmed backdrop: title and quiet line, a body that scrolls under a fixed header and footer, Escape and backdrop close, focus kept inside and handed back.

oxyn add dialog
MCP
Atlas · Run 248
Dioxus
rsx! {
    Dialog {
        title: "Agent permissions",
        description: "Applies to new runs in Atlas",
        trigger_label: "Permissions",
        confirm_label: "Save",
        busy_ms: 1200,
        on_confirm: move |_| save(),
    }
}

Rendered from Rust at build time · goes live when visible

When to use

  • A focused task or a confirmation the user must answer before going back to the page: editing an agent's permissions, renaming a project, confirming that a run, a worktree or a whole project should be deleted.
  • The rest of the app dims and waits.

When not to use

  • The dialog docked to an edge for inspectors and run details: use Sheet instead.
  • Nested sheets with depth: use Sheet stack instead.
  • A sheet that rests at a peek or full height and follows your finger: use Bottom sheet instead.

Installation

Dialog is free and MIT. The oxyn CLI copies its code, and the components it needs, into src/oxyn/ of your Dioxus or GPUI project, so it is yours to change.

Terminal
cargo install --git https://github.com/ismailqureshi72/Oxyn oxyn-cli
oxyn init
oxyn add dialog
Rust
use crate::oxyn::{Dialog, PRIMITIVES_CSS};

Rather depend on the crate? cargo add oxyn-dioxus oxyn-core --git https://github.com/ismailqureshi72/Oxyn, then use oxyn_dioxus::{Dialog, PRIMITIVES_CSS};

Usage

Dioxus · rust
rsx! {
    Dialog {
        title: "Agent permissions",
        description: "Applies to new runs in Atlas",
        trigger_label: "Permissions",
        confirm_label: "Save",
        busy_ms: 1200,
        on_confirm: move |_| save(),
    }
}

Examples

Form

Settings with a Save footer.

Atlas · Run 248
Code
rsx! {
    Dialog {
        title: "Agent permissions",
        description: "Applies to new runs in Atlas",
        trigger_label: "Permissions",
        confirm_label: "Save",
        busy_ms: 1200,
        on_confirm: move |_| save(),
    }
}

Confirm danger

An alert dialog with a red confirm that runs before closing.

Atlas · Run 248

Delete project?

Atlas · 3 agents · 214 runs

The agent's worktree, 14 checkpoints and the run history for atlas-refactor will be deleted. This can't be undone.

Code
rsx! {
    Dialog {
        title: "Agent permissions",
        description: "Applies to new runs in Atlas",
        trigger_label: "Permissions",
        size: "sm",
        tone: "danger",
        confirm_label: "Save",
        busy_ms: 1200,
        on_confirm: move |_| save(),
    }
}

Sticky

Backdrop and Escape don't close it.

Atlas · Run 248
Code
rsx! {
    Dialog {
        title: "Agent permissions",
        description: "Applies to new runs in Atlas",
        trigger_label: "Permissions",
        close_on_backdrop: false,
        confirm_label: "Save",
        busy_ms: 1200,
        on_confirm: move |_| save(),
    }
}

Floating

Non-modal: the page stays live behind it.

Atlas · Run 248
Code
rsx! {
    Dialog {
        title: "Agent permissions",
        description: "Applies to new runs in Atlas",
        trigger_label: "Permissions",
        modal: false,
        confirm_label: "Save",
        busy_ms: 1200,
        on_confirm: move |_| save(),
    }
}

Closed

Just the trigger.

Atlas · Run 248
Code
rsx! {
    Dialog {
        title: "Agent permissions",
        description: "Applies to new runs in Atlas",
        trigger_label: "Permissions",
        confirm_label: "Save",
        busy_ms: 1200,
        on_confirm: move |_| save(),
    }
}

API reference

Dialog

PropTypeDefaultDescription
titlerequiredString—Title (names the dialog).
descriptionOption<String>Default::default()Quiet line (describes it).
openboolDefault::default()Start open.
trigger_labelOption<String>Default::default()A secondary button that opens it.
sizeString"md"`sm` · `md` · `lg` · `full`.
widthOption<f32>Default::default()Width px (overrides size).
close_on_backdropbooltrueA press on the backdrop closes it.
close_on_escapebooltrueEscape closes it.
close_buttonbooltrueThe × button.
close_labelString"Close"Its label.
containedboolDefault::default()Inside the nearest positioned ancestor instead of the viewport.
modalbooltrueModal (traps focus, dims the page). Off = floating card.
toneString"default"`default` · `danger` (an alert dialog with a red confirm).
confirm_labelOption<String>Default::default()Footer confirm label (adds Cancel + Confirm).
cancel_labelString"Cancel"Cancel label.
busy_msu32Default::default()Oxyn plus: the confirm runs this long (spinner, can't dismiss).
childrenElementDefault::default()Body.
on_open_changeEventHandler<bool>—Open state changed.
on_confirmEventHandler<()>—Confirm finished.

Read from the Rust signature and doc comments.

Keyboard interactions

KeyAction
EscClose and return focus to the trigger
TaborShiftTabCycle focus inside
EnterRun the focused button

Accessibility

  • role=dialog (alertdialog when danger) with aria-modal, named by the title and described by the quiet line.
  • Focus moves into the dialog and wraps at both ends; closing hands it back to the trigger.
  • While a confirm runs the dialog is aria-busy and can't be dismissed.
From the spec

Focus moves into the panel on open and wraps at both ends with sentinel guards; on close it returns to the trigger. The title names the dialog and the quiet line describes it. Danger dialogs are alertdialog. The close button is labelled (close_label, default "Close").

Motion & interaction

The scrim fades in with a 3 px backdrop blur. The panel rises 8 px from 0.96 scale; the title rises out of a 3 px blur. Exit is quicker than enter. The close button tints on hover; the confirm spinner sits before its label so the width barely moves.

Timing
TransitionDurationEasingReduced motion
Scrim in200 msease.out120 ms fade
Panel in240 ms, 8 px, 0.96 → 1ease.out120 ms fade
Panel out160 ms, to 0.98ease.outinstant
Busy confirmbusy_ms (default 0)linear timersame

Responsive behaviour

  • min(viewport − 32 px, size) wide and capped at the viewport height; the body scrolls.
Edge cases (spec)

Long titles wrap; long bodies scroll under the fixed header and footer. On a phone the panel is viewport − 32 px wide and full fills the viewport with a 16 px margin. Dialogs opened from a menu restore focus to the menu's trigger. A run finishing while the confirm is busy is the host's to reconcile.

Notes for AI

  • Import Dialog from oxyn_dioxus and include PRIMITIVES_CSS plus the token stylesheet once.
  • A GPUI version exists: DialogEl in oxyn_gpui.
  • Props to set first: title.
  • Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.

Guides

Oxyn · 74 free components · 264 Pro components · 96 screens · 20 blocks · Dioxus and GPUI