pub fn scaffold() -> ScaffoldBuilderExpand description
§scaffold
Layout top/bottom bars with floating content for app screens with persistent actions.
§Usage
Use for screens with app bars, floating actions, and transient messages.
§Parameters
modifier— optional modifier chain applied to the scaffold container.window_insets— optional window insets applied to all slots after subtracting insets consumed by ancestors. UseWindowInsets::SafeDrawingfor a window-sized scaffold.container_color— optional background color that extends under the insets. With window insets and a theme, defaults to the theme’s surface.content_padding— optional padding applied around the content area.content— optional main content slot.top_bar— optional top bar slot.bottom_bar— optional bottom bar slot.floating_action_button— optional floating action button slot.floating_action_button_alignment— optional floating action button alignment.floating_action_button_offset— additional x/y offset applied to the floating action button, defaulting to0dp.snackbar_host— optional snackbar host slot.snackbar_alignment— optional snackbar host alignment.snackbar_offset— additional x/y offset applied to the snackbar host, defaulting to0dp.
§Examples
use tessera_components::app_bar::top_app_bar;
use tessera_components::scaffold::scaffold;
use tessera_components::text::text;
use tessera_components::theme::{MaterialTheme, material_theme};
use tessera_ui::tessera;
#[tessera]
fn demo() {
material_theme()
.theme(|| MaterialTheme::default())
.child(|| {
scaffold()
.top_bar(|| {
top_app_bar().title("Inbox");
})
.content(|| {
text("Hello scaffold");
});
});
}