Tooltip
One line of small text on a dark pill, centred above a box you hold, or placed by the mouse. It is built into the runtime's tooltip root, so it is drawn over everything and takes nothing: the pointer goes through it.

Fixture: tooltip-above.
Build
public static Box Build(BibuiRuntime runtime, ReadOnlySpan<char> text, Box? anchor = null)| Parameter | Meaning |
|---|---|
text | What it reads. |
anchor | The box it sits above, 8 px clear and centred, where it was drawn last frame. With no anchor, it sits by the mouse at runtime.DefaultToolTipOffset. |
Claims and reports
None. It returns the pill's Box.
State the caller owns
When to show it. It decides nothing: build it in a frame you want it, usually while the trigger reports Hovering.
Theme tokens
- Pill: a
TextPrimaryfill and theruntime.Theme.Elevationtooltip shadow. - Text:
Background, at the small size. The pill inverts the page's colours.
Example
using Bibui.Core;
using Bibui.Core.Runtime;
sealed class CopyButton
{
const string Copy = "Copy";
const string Tip = "Copy to clipboard";
public UiNode Build(BibuiRuntime runtime)
{
var copy = runtime.Button("copy", Copy, ghost: true);
if (copy.Hovering) Tooltip.Build(runtime, Tip, (Box)copy.Node);
if (copy.Clicked) runtime.ClipboardSet("copied text");
return copy;
}
}