Skip to content
Eskais UI

Overlays

Tooltip

UI SDK Tooltip parts: names or describes its trigger, opens on hover and keyboard focus, Escape closes it, optional shortcut and arrow. ControlTooltip gives an icon-only control its name in a tooltip.

Example

Installation

npx shadcn@latest add @eskais/tooltip

Usage

Import
import {  ControlTooltip,  createTooltipController,  Tooltip,  TooltipArrow,  TooltipContent,  TooltipShortcut,  TooltipTrigger,} from "@/components/ui/tooltip"

API reference

ControlTooltip

PropTypeDefault
labelThe control's accessible name. The tooltip repeats it unless `tooltip` gives other text.string–
tooltipControlTooltipOption–
iconOnlyShows `label` without being asked to, for a control with no visible text.booleantrue
shortcutKeys shown after the text, like `"mod+s"`.string–
agentPressableLists the tooltip in the agent snapshot under the control's name, so an agent can press a control that isn't a component of its own, like a collapsible's trigger. Otherwise it stays out, since it repeats the control's name.booleanfalse
childrenrequiredThe control, rendered as the tooltip's trigger: it receives the trigger's props and ref. A natively `disabled` one can't be focused, so it gets no tooltip; `focusableWhenDisabled` keeps it. One that is already labelled or described by something else, like the `TooltipTrigger` it renders for, keeps that, and an `aria-hidden` one gets none.ReactElement<TriggerProps>–

Other exports

createTooltipControllerTooltipTooltipTriggertype ControlTooltipOptiontype ControlTooltipProps

Accessibility

  • Names or describes its trigger; opens on hover and focus, never holds interactive content.
  • Escape dismisses it without moving focus.
  • A touch screen never opens it, so it never covers the finger or hides what a tap does.

Agent actions

Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.