Function freya::components::SnackBar
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 open = use_signal(|| false);
rsx!(
rect {
height: "100%",
width: "100%",
Button {
onpress: move |_| open.toggle(),
label { "Open" }
}
SnackBar {
open,
label {
"Hello, World!"
}
}
}
)
}
§Props
For details, see the props struct definition.
open
:ReadOnlySignal<bool>
Open or not the SnackBar. You can pass a ReadOnlySignal as well.
theme
:Option<SnackBarThemeWith>
Theme override.