-
Notifications
You must be signed in to change notification settings - Fork 9
Component Tooltip
MeowLynxSea edited this page Jan 24, 2026
·
4 revisions
A tooltip view builder.
Tooltips in Yororen UI are built as views. The common pattern is:
- Create a tooltip builder via
tooltip("...") - Call
.build()to obtain a view factory - Attach it to an interactive element that supports
.tooltip(...)(for exampleClickableSurface)
- Clarifying icon-only actions (e.g. close buttons)
- Explaining non-obvious controls
Not a good fit:
- Critical or persistent information (use inline
Labelor help text)
use yororen_ui::component::{clickable_surface, tooltip};
let view = clickable_surface()
.child("Hover me")
.tooltip(tooltip("Hello").build());-
tooltip("...")/Tooltip::text("..."): constructor -
placement(TooltipPlacement): placement hint (Auto,Top,Right,Bottom,Left) -
bg(Hsla)/text_color(Hsla) -
build() -> impl Fn(&mut Window, &mut App) -> AnyView: create a view factory
- Tooltip rendering/triggering is handled by the host element/GPUI; this type just defines the view.
- Placement:
TooltipPlacement::Auto - Background:
theme.action.neutral.bg - Text color:
theme.action.neutral.fg
use gpui::rgb;
use yororen_ui::component::{TooltipPlacement, clickable_surface, tooltip};
let view = clickable_surface()
.child("Hover")
.tooltip(
tooltip("Pinned to top")
.placement(TooltipPlacement::Top)
.bg(rgb(0x121214))
.text_color(rgb(0xFFFFFF))
.build(),
);Yororen UI v0.3.0 · repository · Apache-2.0 · This wiki documents Yororen UI v0.3.0.
This wiki documents Yororen UI v0.3.0 — the headless-core, swappable-renderer build.