Tooltip
Generated from public Vue/TypeScript exports by
pnpm docs:generate. Edit source comments and stories to update this reference. Types describe the declared API; browser/device constraints are covered in the guides. This catalog reflects source commitfc6bfb108634735f1657e533206c3f8702ad357d; match your installed package and typed manifest before using an export. Source review does not establish registry-release availability.
Tooltip
import { Tooltip } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
defaultOpen | boolean | undefined | — | The open state of the tooltip when it is initially rendered. Use when you do not need to control its open state. |
open | boolean | undefined | — | The controlled open state of the tooltip. |
delayDuration | number | undefined | — | Override the duration given to the Provider to customise the open delay for a specific tooltip. |
disableHoverableContent | boolean | undefined | — | Prevents Tooltip.Content from remaining open when hovering. Disabling this has accessibility consequences. Inherits from Tooltip.Provider. |
disableClosingTrigger | boolean | undefined | — | When true, clicking on trigger will not close the content. |
disabled | boolean | undefined | — | When true, disable tooltip |
ignoreNonKeyboardFocus | boolean | undefined | — | Prevent the tooltip from opening if the focus did not come from the keyboard by matching against the :focus-visible selector. This is useful if you want to avoid opening it when switching browser tabs or closing a dialog. |
Events
| Name | Type | Required / default | Description |
|---|---|---|---|
update:open | [value: boolean] | — | — |
Slots
| Name | Type | Required / default | Description |
|---|---|---|---|
default | {} | — | — |
Examples
These are authored Storybook excerpts, not complete standalone modules. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.
Default
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '.'
import { Button } from '../button'
{
render: () => ({
components: { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Button },
template: `
<TooltipProvider>
<Tooltip>
<TooltipTrigger as-child>
<Button variant="outline">Hover me</Button>
</TooltipTrigger>
<TooltipContent>
<p>Add to library</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
`,
}),
}
TooltipContent
import { TooltipContent } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
forceMount | boolean | undefined | — | Used to force mounting when more control is needed. Useful when controlling animation with Vue animation libraries. |
ariaLabel | string | undefined | — | By default, screenreaders will announce the content inside the component. If this is not descriptive enough, or you have content that cannot be announced, use aria-label as a more descriptive label. |
asChild | boolean | undefined | — | Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details. |
as | AsTag | Component | undefined | — | The element or component this component should render as. Can be overwritten by asChild. |
side | "top" | "right" | "bottom" | "left" | undefined | — | The preferred side of the trigger to render against when open. Will be reversed when collisions occur and avoidCollisions is enabled. |
sideOffset | number | undefined | 4 | The distance in pixels from the trigger. |
align | "start" | "center" | "end" | undefined | — | The preferred alignment against the trigger. May change when collisions occur. |
alignOffset | number | undefined | — | An offset in pixels from the start or end alignment options. |
avoidCollisions | boolean | undefined | — | When true, overrides the side and align preferences to prevent collisions with boundary edges. |
collisionBoundary | Element | (Element | null)[] | null | undefined | — | The element used as the collision boundary. By default this is the viewport, though you can provide additional element(s) to be included in this check. |
collisionPadding | number | Partial<Record<"top" | "right" | "bottom" | "left", number>> | undefined | — | The distance in pixels from the boundary edges where collision detection should occur. Accepts a number (same for all sides), or a partial padding object, for example: { top: 20, left: 20 }. |
arrowPadding | number | undefined | — | The padding between the arrow and the edges of the content. If your content has border-radius, this will prevent it from overflowing the corners. |
sticky | "partial" | "always" | undefined | — | The sticky behavior on the align axis. partial will keep the content in the boundary as long as the trigger is at least partially in the boundary whilst "always" will keep the content in the boundary regardless. |
hideWhenDetached | boolean | undefined | — | Whether to hide the content when the trigger becomes fully occluded. |
positionStrategy | "absolute" | "fixed" | undefined | — | The type of CSS position property to use. |
updatePositionStrategy | "always" | "optimized" | undefined | — | Strategy to update the position of the floating element on every animation frame. |
portalTo | string | HTMLElement | undefined | — | — |
disablePortal | boolean | undefined | — | — |
Events
| Name | Type | Required / default | Description |
|---|---|---|---|
escapeKeyDown | [event: KeyboardEvent] | — | — |
pointerDownOutside | [event: Event] | — | — |
Slots
| Name | Type | Required / default | Description |
|---|---|---|---|
default | {} | — | — |
Examples
These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.
Default
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '.'
import { Button } from '../button'
{
render: () => ({
components: { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Button },
template: `
<TooltipProvider>
<Tooltip>
<TooltipTrigger as-child>
<Button variant="outline">Hover me</Button>
</TooltipTrigger>
<TooltipContent>
<p>Add to library</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
`,
}),
}
TooltipProvider
import { TooltipProvider } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
delayDuration | number | undefined | — | The duration from when the pointer enters the trigger until the tooltip gets opened. |
skipDelayDuration | number | undefined | — | How much time a user has to enter another trigger without incurring a delay again. |
disableHoverableContent | boolean | undefined | — | When true, trying to hover the content will result in the tooltip closing as the pointer leaves the trigger. |
disableClosingTrigger | boolean | undefined | — | When true, clicking on trigger will not close the content. |
disabled | boolean | undefined | — | When true, disable tooltip |
ignoreNonKeyboardFocus | boolean | undefined | — | Prevent the tooltip from opening if the focus did not come from the keyboard by matching against the :focus-visible selector. This is useful if you want to avoid opening it when switching browser tabs or closing a dialog. |
content | TooltipContentProps | undefined | — | Default settings that will be used by all tooltip components. |
Slots
| Name | Type | Required / default | Description |
|---|---|---|---|
default | {} | — | — |
Examples
These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.
Default
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '.'
import { Button } from '../button'
{
render: () => ({
components: { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Button },
template: `
<TooltipProvider>
<Tooltip>
<TooltipTrigger as-child>
<Button variant="outline">Hover me</Button>
</TooltipTrigger>
<TooltipContent>
<p>Add to library</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
`,
}),
}
TooltipTrigger
import { TooltipTrigger } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
reference | ReferenceElement | undefined | — | The reference (or anchor) element that is being referred to for positioning. If not provided will use the current component as anchor. |
asChild | boolean | undefined | — | Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details. |
as | AsTag | Component | undefined | — | The element or component this component should render as. Can be overwritten by asChild. |
Slots
| Name | Type | Required / default | Description |
|---|---|---|---|
default | {} | — | — |
Examples
These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.
Default
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '.'
import { Button } from '../button'
{
render: () => ({
components: { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Button },
template: `
<TooltipProvider>
<Tooltip>
<TooltipTrigger as-child>
<Button variant="outline">Hover me</Button>
</TooltipTrigger>
<TooltipContent>
<p>Add to library</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
`,
}),
}