Skip to main content

full_screen_dialog

Function full_screen_dialog 

Source
pub fn full_screen_dialog(
    on_close: impl Into<Callback> + Send + Sync + 'static,
) -> FullScreenDialogBuilder
Expand description

§full_screen_dialog

Present a scrollable form with a close action and optional save action.

§Usage

Edit information or complete a task that needs the available screen height.

§Parameters

  • on_close — callback invoked by the close button.
  • modifier — modifier chain applied to the content surface.
  • title — optional headline in the top bar.
  • confirm_label — text for the optional confirm action, defaulting to Save.
  • on_confirm — optional callback; omitting it hides the confirm action.
  • content — scrollable form or task content.

§Examples

use tessera_components::{
    dialog::{dialog_provider, full_screen_dialog},
    text::text,
    theme::material_theme,
};
use tessera_ui::{Callback, remember, tessera};
#[tessera]
fn example() {
    material_theme().child(|| {
        let open = remember(|| true);
        let close = Callback::new(move || open.set(false));
        dialog_provider()
            .is_open(open.get())
            .full_screen(true)
            .on_close_request_shared(close)
            .main_content(|| {
                text("Calendar");
            })
            .dialog_content(move |dialog| {
                full_screen_dialog(close).dialog(dialog).title("New event").content(|| {
                    text("Event details");
                });
            });
        close.call();
        assert!(!open.get());
    });
}