Tooltip
Contextual information that appears on hover or focus. Non-interactive — for supplementary descriptions only.
Primitive: TooltipARIA: role="tooltip"Keyboard: Escape dismisses
Hover me
This is a tooltip
Focus me
Tooltip below
tooltip.rs
use stratum_leptos::*;
view! {
<Tooltip content="This is a tooltip">
<Button variant=ButtonVariant::Outline>
"Hover me"
</Button>
</Tooltip>
}Installation
stratum add tooltipProps
| Prop | Type | Default | Description |
|---|---|---|---|
| open | Option<bool> | None | Controlled open state |
| default_open | bool | false | Initial open state |
| delay_ms | u32 | 700 | Delay before showing (ms) |
| side | TooltipSide | Top | Placement: Top, Right, Bottom, Left |
| on_open_change | Option<Callback<bool>> | None | Fires when visibility changes |
Accessibility
- Content renders with
role="tooltip". - Trigger gets
aria-describedbypointing to the tooltip content. - Opens on hover (
PointerEnter) and focus. Closes on blur andEscape. - Tooltip content is non-interactive — use Popover for interactive overlays.