dialog_provider

Function dialog_provider 

Source
pub fn dialog_provider(
    args: DialogProviderArgs,
    state: DialogProviderState,
    main_content: impl FnOnce(),
    dialog_content: impl FnOnce(f32) + Send + Sync + 'static,
)
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

  • args — configuration for dialog appearance and the on_close_request callback; see DialogProviderArgs.
  • state — a clonable DialogProviderState handle; use DialogProviderState::new() to create one.
  • main_content — closure that renders the always-visible base UI.
  • dialog_content — closure that renders dialog content; receives a f32 alpha for animation.

§Examples

use tessera_ui_basic_components::dialog::DialogProviderState;
let state = DialogProviderState::new();
assert!(!state.is_open());
state.open();
assert!(state.is_open());
state.close();
assert!(!state.is_open());