Tooltip
To build in the appCanon tooltip from the catalog's rt-tooltip: level 1 of the disclosure ladder, a read-only line of text that hover or keyboard focus reveals and Escape dismisses. Inverted panel (stone-dark on a 2px mustard border, brutalist-sm shadow) with a matching arrow. Built on Radix Tooltip with a Provider per instance; the catalog's text-sm is text-ui-sm here. Icon-only Buttons carry one automatically from their title. The canon points this at the floating-tooltip controller, which has no arrow or border (conflict 16, see HANDOFF).
App: Ui::TooltipComponent (to build)
Four sides
#sidesHover or focus a trigger. The arrow rotates with the side; the panel flips when it would leave the viewport.
Start and end alignments
#alignments-start and -end align the panel's edge with the trigger's; the arrow stays on the trigger, 8px clear of the corners.
Delays
#delaysThe hover delay defaults to 300ms. Keyboard focus never waits.
Longer text with max_width
#max-widthText stays on one line unless max_width is set, then it wraps at that width.
On a disabled button
#disabled-triggerA disabled button emits no pointer events, so the trigger is a focusable span around it. Disabled still explains why (principle P8). Icon-only Buttons do this themselves.
Props
| Name | Type | Default | Notes |
|---|---|---|---|
| text | string | — | Required. The tooltip line |
| placement | top | top-start | top-end | bottom | bottom-start | bottom-end | left | left-start | left-end | right | right-start | right-end | top | Floating UI placement, mapped to Radix side + align. Flips and shifts on collision (8px padding) |
| offset | number | 8 | Px between the trigger and the panel; the 6px arrow sits in the gap |
| delay | number | 300 | Hover delay in ms. Focus shows it at once |
| max_width | number | — | Px. Sets max-width and lets the text wrap (otherwise nowrap) |
| children | ReactElement | — | One focusable element that forwards ref and props (rendered with Radix asChild). Wrap a disabled control in <span tabIndex={0}> so it still explains itself |