Skip to main content

dialog_provider

Function dialog_provider 

Source
pub fn dialog_provider() -> DialogProviderBuilder
Expand description

§dialog_provider

Provide a modal dialog at the top level of an application.

§Usage

Show modal content for alerts, confirmation dialogs, multi-step forms, or onboarding steps that require blocking user interaction with the main UI.

§Parameters

  • accessibility_label — accessible name overriding the standard content title.
  • accessibility_description — description overriding basic supporting text; provide this for custom content that needs a concise accessible summary.
  • role — dialog purpose; use DialogRole::AlertDialog for an urgent message that requires a response. Defaults to DialogRole::Dialog.
  • on_close_request — optional close-request callback.
  • padding — padding applied inside the dialog surface.
  • full_screen — fill the available height without outer margins or rounded corners; width remains limited to 560dp.
  • is_open — declarative open state.
  • controller — optional external controller.
  • main_content — optional main content rendered behind the dialog.
  • dialog_content — modal content receiving its explicit dialog scope.

§Examples

use tessera_components::dialog::{basic_dialog, dialog_provider};

dialog_provider()
    .accessibility_label("Dialog Title")
    .on_close_request(|| {})
    .is_open(true)
    .main_content(|| { /* main content */ })
    .dialog_content(|dialog| {
        basic_dialog().dialog(dialog)
            .supporting_text("This is the dialog body text.")
            .headline("Dialog Title");
    });