Function freya::components::Popup

source ·
pub fn Popup<'a>(__props: PopupProps) -> Option<VNode>
Expand description

Popup component.

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 {
                     label {
                         "Awesome Popup"
                     }
                 }
                 PopupContent {
                     label {
                         "Some content"
                     }
                 }
             }
         }
         Button {
             onclick: move |_| show_popup.set(true),
             label {
                 "Open"
             }
         }
    )
}
*For details, see the [props struct definition](PopupProps).*
- [`children`](PopupProps::children) : `Element`<p>Popup inner content.</p>
- [`oncloserequest`](PopupProps::oncloserequest) : `Option<EventHandler>`<p>Optional close request handler.</p>
- [`show_close_button`](PopupProps::show_close_button) : `bool`<p>Whether to show or no the cross button in the top right corner.</p>