euv_ui/component/tooltip/view/struct.rs
1use super::*;
2
3/// The side of the trigger the [`euv_tooltip`] bubble is rendered on.
4#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
5pub enum EuvTooltipPlacement {
6 /// Above the trigger, horizontally centred.
7 #[default]
8 Top,
9 /// Below the trigger, horizontally centred.
10 Bottom,
11 /// Left of the trigger, vertically centred.
12 Left,
13 /// Right of the trigger, vertically centred.
14 Right,
15}
16
17/// Props for the [`euv_tooltip`] component.
18///
19/// The trigger element is supplied as children; the bubble carries `text`.
20#[derive(Clone, CustomDebug, Default)]
21pub struct EuvTooltipProps {
22 /// The hint text rendered inside the bubble.
23 pub text: &'static str,
24 /// The side of the trigger the bubble is anchored to.
25 pub placement: EuvTooltipPlacement,
26}