pub struct TooltipProps {
pub text: String,
pub placement: TooltipPlacement,
pub fallback_placements: Vec<TooltipPlacement>,
pub trigger: TooltipTriggers,
pub delay: TooltipDelay,
pub open: Option<bool>,
pub offset: OverlayOffset,
pub boundary_padding: f64,
pub class: String,
pub children: Element,
}Expand description
Bootstrap Tooltip component.
Renders a Bootstrap tooltip 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="tooltip" data-bs-placement="top" title="Tooltip text">Hover me</button>rsx! {
Tooltip { text: "Save your work", placement: TooltipPlacement::Top,
Button { color: Color::Primary, "Save" }
}
Tooltip {
text: "Click for details",
trigger: TooltipTriggers::CLICK,
placement: TooltipPlacement::Auto,
Button { color: Color::Info, "Details" }
}
}Fields§
§text: StringTooltip text content.
placement: TooltipPlacementRequested placement relative to the trigger element.
fallback_placements: Vec<TooltipPlacement>Fallback placements used when requested placement does not fit.
trigger: TooltipTriggersTrigger behavior. Defaults to hover plus focus.
delay: TooltipDelayShow/hide delay in milliseconds.
open: Option<bool>Controlled open state. When set, internal triggers are ignored.
offset: OverlayOffsetOffset from the trigger.
boundary_padding: f64Padding inside the viewport boundary.
class: StringAdditional CSS classes for the tooltip element.
children: ElementChild element or elements that act as the trigger.
Implementations§
Source§impl TooltipProps
impl TooltipProps
Sourcepub fn builder() -> TooltipPropsBuilder<((), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> TooltipPropsBuilder<((), (), (), (), (), (), (), (), (), ())>
Create a builder for building TooltipProps.
On the builder, call .text(...), .placement(...)(optional), .fallback_placements(...)(optional), .trigger(...)(optional), .delay(...)(optional), .open(...)(optional), .offset(...)(optional), .boundary_padding(...)(optional), .class(...)(optional), .children(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of TooltipProps.
Trait Implementations§
Source§impl Clone for TooltipProps
impl Clone for TooltipProps
Source§fn clone(&self) -> TooltipProps
fn clone(&self) -> TooltipProps
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more