Tooltip
Reveal concise supporting text from keyboard focus or pointer hover.
Usage
Focus hover
Show the same supporting text from pointer hover and keyboard focus.
Show the same supporting text from pointer hover and keyboard focus.
<!-- Tooltip / Focus Hover -->
<script setup lang="ts">
import { TooltipRoot, TooltipTrigger, TooltipContent, TooltipArrow } from '@sectile/vue/tooltip'
</script>
<template>
<TooltipRoot side="top">
<TooltipTrigger>Hover or focus</TooltipTrigger>
<TooltipContent>
<TooltipArrow />
Keyboard shortcut: ⌘K
</TooltipContent>
</TooltipRoot>
</template>Initially open
Begin open without occupying layout space around the trigger.
Begin open without occupying layout space around the trigger.
<!-- Tooltip / Initially Open -->
<script setup lang="ts">
import { TooltipRoot, TooltipTrigger, TooltipContent, TooltipArrow } from '@sectile/vue/tooltip'
</script>
<template>
<TooltipRoot side="top">
<TooltipTrigger>Hover or focus</TooltipTrigger>
<TooltipContent>
<TooltipArrow />
Keyboard shortcut: ⌘K
</TooltipContent>
</TooltipRoot>
</template>Controlled
Let the parent own the current value and apply accepted changes back to the component.
Let the parent own the current value and apply accepted changes back to the component.
<!-- Tooltip / Controlled -->
<script setup lang="ts">
import { TooltipRoot, TooltipTrigger, TooltipContent, TooltipArrow } from '@sectile/vue/tooltip'
</script>
<template>
<TooltipRoot side="top">
<TooltipTrigger>Hover or focus</TooltipTrigger>
<TooltipContent>
<TooltipArrow />
Keyboard shortcut: ⌘K
</TooltipContent>
</TooltipRoot>
</template>Floating positioning
This component uses the shared positioning engine. Use the live positioning example to change side, align, offsets, collision boundaries, strategy, and tracking while inspecting the resolved placement.
API
Vue package: @sectile/vue/tooltip
TooltipRootTooltipTriggerTooltipPortalTooltipContentTooltipArrow
Props
TooltipRootProps
alignAlignment of positioned content relative to its anchor.
arrowPaddingMinimum space kept between an arrow and the edge of positioned content.
avoidCollisionsWhether positioned content may flip or shift to remain visible.
collisionBoundaryBoundary used to keep positioned content visible.
collisionPaddingSpace kept between positioned content and its collision boundary.
defaultOpenInitial uncontrolled open state.
disabledWhether interaction is unavailable.
hideWhenDetachedWhether positioned content hides when its anchor leaves the layout.
openWhether the associated popup or disclosure is open.
positionWhether the popup is positioned relative to its trigger.
sidePreferred side of the anchor for positioned content.
sideOffsetDistance between positioned content and its anchor.
strategyCSS positioning strategy used for anchored content.
trackingUpdate strategy used while anchored content is open.
unmountOnExitWhether presence-managed content is removed from the DOM after its exit motion completes.
TooltipPartProps
asElement or component rendered for this part.
asChildWhether to merge this part into its single child instead of rendering a wrapper.
TooltipPortalProps
deferWhether Teleport target resolution waits until the end of the current mount or update tick.
disabledWhether interaction is unavailable.
toTeleport target for portalled content.
Slots
TooltipRootSlotProps
disabledWhether interaction is unavailable.
openWhether the associated popup or disclosure is open.
Other types
TooltipOpenChangeHandler
type TooltipOpenChangeHandler = PopupFactoryOptions['onOpenChange']Parts
Shared scope: [data-scope="tooltip"]. Combine it with a part selector to keep styles local to this component.
| Part | Selector | Role | Extra attributes |
|---|---|---|---|
trigger | [data-part="trigger"] | Opens, closes, or activates the associated content. | — |
content | [data-part="content"] | Contains the component content shown for the active state. | — |
arrow | [data-part="arrow"] | Visually connects floating content to its anchor. | — |
Keyboard interaction
| Key | Behavior |
|---|---|
| Tab | Reveal the tooltip when its trigger receives keyboard focus. |
| Escape | Dismiss the visible tooltip. |
Accessibility
The tooltip is associated with its trigger as a description and never receives focus itself.
See the corresponding WAI-ARIA pattern for the host accessibility contract.
