@lattice-ui/tooltip Part of the stable direction toward v1.0.
What It Is For
Use Tooltip for short contextual hints that appear on hover or selection focus without interrupting the surrounding workflow.
It is best for explaining nearby UI affordances, not for delivering required instructions or deep interaction flows.
import { PortalProvider } from "@lattice-ui/layer";
import { Tooltip } from "@lattice-ui/tooltip";
type Props = {
playerGui: PlayerGui;
};
function TooltipDemo() {
return (
<Tooltip.Provider delayDuration={500} skipDelayDuration={250}>
<Tooltip.Root>
<Tooltip.Trigger asChild>
<textbutton
AutoButtonColor={false}
BackgroundColor3={Color3.fromRGB(53, 104, 196)}
BorderSizePixel={0}
Size={UDim2.fromOffset(180, 40)}
Text="Hover or focus me"
TextColor3={Color3.fromRGB(240, 244, 250)}
TextSize={14}
>
<uicorner CornerRadius={new UDim(0, 8)} />
</textbutton>
</Tooltip.Trigger>
<Tooltip.Portal>
<Tooltip.Content
asChild
offset={new Vector2(0, 8)}
placement="bottom"
>
<frame
BackgroundColor3={Color3.fromRGB(22, 28, 39)}
BorderSizePixel={0}
Size={UDim2.fromOffset(220, 74)}
>
<uicorner CornerRadius={new UDim(0, 8)} />
<textlabel
BackgroundTransparency={1}
Position={UDim2.fromOffset(10, 10)}
Size={UDim2.fromOffset(200, 48)}
Text="Tooltips work best for short supplemental hints, not required instructions."
TextColor3={Color3.fromRGB(236, 240, 248)}
TextSize={13}
TextWrapped={true}
TextXAlignment={Enum.TextXAlignment.Left}
TextYAlignment={Enum.TextYAlignment.Top}
/>
</frame>
</Tooltip.Content>
</Tooltip.Portal>
</Tooltip.Root>
</Tooltip.Provider>
);
}
export function TooltipExample(props: Props) {
return (
<PortalProvider container={props.playerGui}>
<TooltipDemo />
</PortalProvider>
);
} Live demo is experimental and may contain bugs.
Install
Global CLI command: lattice add tooltip
Monorepo local script
Use your package manager wrapper when running the local lattice command.
pnpm lattice add tooltipPublic Exports
-
Tooltip -
Tooltip.Provider -
Tooltip.Root -
Tooltip.Trigger -
Tooltip.Portal -
Tooltip.Content
State Model
Tooltip.Providertracks open-delay policy withdelayDurationandskipDelayDurationacross multiple tooltips.Tooltip.Rootcan be controlled or uncontrolled and keeps refs for both the trigger and the positioned content.- Tooltip activity can come from hover or focus/selection, and the provider decides whether the next tooltip should open with a shorter skip delay.
Key API
Tooltip.Provider
Use provider-level delay settings when multiple tooltips in one region should feel consistent and benefit from skip-delay behavior.
Tooltip.Root
Use open, defaultOpen, delayDuration, and onOpenChange when one tooltip needs explicit state ownership.
Tooltip.Content
Use placement, offset, padding, and outside-interaction hooks to position the hint surface without rebuilding overlay math.
Composition Patterns
Dense control hints
Wrap icon-only or compact controls with tooltips when nearby text would create too much layout noise.
Shared timing regions
Use one provider around a toolbar or command strip so moving between nearby controls feels responsive instead of repeatedly delayed.
Cautions / Limits
- Tooltips should stay short and supplemental; do not hide required instructions or destructive confirmations inside them.
- Like other anchored overlays, tooltips benefit from a shared
PortalProviderfor predictable mounting and stacking. - Use
motionfor delay-aware entrance and exit behavior, but keep required instructions outside tooltip-only UI.