pub fn Popup(_: PopupProps) -> ElementExpand description
Floating window intended for quick interactions. Also called Dialog in other frameworks.
§Styling
Inherits the PopupTheme theme.
fn app() -> Element {
let mut show_popup = use_signal(|| false);
rsx!(
if *show_popup.read() {
Popup {
oncloserequest: move |_| {
show_popup.set(false)
},
PopupTitle {
text: "Awesome Popup"
}
PopupContent {
label {
"Some content"
}
}
}
}
Button {
onpress: move |_| show_popup.set(true),
label {
"Open"
}
}
)
}§Props
For details, see the props struct definition.
theme:Option<PopupThemeWith>Theme override.
children:ElementPopup inner content.
oncloserequest:Option<EventHandler>Optional close request handler.
show_close_button:boolWhether to show or no the cross button in the top right corner. Default to
false.close_on_escape_key:boolWhether to trigger close request handler when the Escape key is pressed.