Function freya::prelude::SnackBar

source ·
pub fn SnackBar(__props: SnackBarProps) -> Option<VNode>
Expand description

SnackBar component. Use in combination with other components.

§Styling

Inherits the SnackBarTheme theme.

§Example

fn app() -> Element {
    let mut show = use_signal(|| false);

    rsx!(
        rect {
            height: "100%",
            width: "100%",
            Button {
                onclick: move |_| show.toggle(),
                label { "Open" }
            }
            SnackBar {
                show,
                label {
                    "Hello, World!"
                }
            }
        }
    )
}

§Props

For details, see the props struct definition.

  • show : Signal<bool>

    Signal to show the snackbar or not.

  • theme : Option<SnackBarThemeWith>

    Theme override.