Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
marc2332 committed Mar 3, 2024
1 parent 65b62e2 commit f0e0733
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions crates/components/src/popup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,41 @@ pub fn PopupBackground(children: Element) -> Element {
})
}

/// `Popup` component.
///
/// # Styling
/// Inherits the [`PopupTheme`](freya_hooks::PopupTheme) theme.
/// ```rust, no_run
/// # use freya::prelude::*;
/// 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"
/// }
/// }
/// )
/// }
#[allow(non_snake_case)]
#[component]
pub fn Popup(
Expand Down

0 comments on commit f0e0733

Please sign in to comment.