pub struct PopoverProps {
pub title: String,
pub body: Element,
pub placement: PopoverPlacement,
pub fallback_placements: Vec<PopoverPlacement>,
pub trigger: PopoverTriggers,
pub delay: PopoverDelay,
pub open: Option<bool>,
pub offset: OverlayOffset,
pub boundary_padding: f64,
pub dismiss_on_outside_click: bool,
pub class: String,
pub children: Element,
}Expand description
Bootstrap Popover component.
Renders Bootstrap popover markup with Dioxus-owned trigger state and viewport-aware placement. It does not depend on Bootstrap JavaScript or Popper.js.
§Bootstrap HTML -> Dioxus
<button data-bs-toggle="popover" data-bs-title="Title" data-bs-content="Content">Click</button>rsx! {
Popover {
title: "Popover Title",
body: rsx! { "Rich content here." },
Button { color: Color::Info, "Click for details" }
}
Popover {
title: "Focus dismiss",
body: rsx! { "Focus another element to dismiss." },
trigger: PopoverTriggers::FOCUS,
placement: PopoverPlacement::Auto,
Button { color: Color::Secondary, "Focus" }
}
}Fields§
§title: StringPopover title text.
body: ElementPopover body content.
placement: PopoverPlacementRequested placement relative to the trigger element.
fallback_placements: Vec<PopoverPlacement>Fallback placements used when requested placement does not fit.
trigger: PopoverTriggersTrigger behavior. Defaults to click.
delay: PopoverDelayShow/hide delay in milliseconds.
open: Option<bool>Controlled open state. When set, internal triggers are ignored.
offset: OverlayOffsetOffset from trigger.
boundary_padding: f64Padding inside viewport boundary.
dismiss_on_outside_click: boolClose uncontrolled popovers when clicking outside the trigger/popover.
class: StringAdditional CSS classes for the popover element.
children: ElementChild element used as the trigger.
Implementations§
Source§impl PopoverProps
impl PopoverProps
Sourcepub fn builder() -> PopoverPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> PopoverPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building PopoverProps.
On the builder, call .title(...)(optional), .body(...), .placement(...)(optional), .fallback_placements(...)(optional), .trigger(...)(optional), .delay(...)(optional), .open(...)(optional), .offset(...)(optional), .boundary_padding(...)(optional), .dismiss_on_outside_click(...)(optional), .class(...)(optional), .children(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of PopoverProps.
Trait Implementations§
Source§impl Clone for PopoverProps
impl Clone for PopoverProps
Source§fn clone(&self) -> PopoverProps
fn clone(&self) -> PopoverProps
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more