Skip to content
Theme:

Ui3nTooltip ​

Tooltip component for displaying additional information on hover or click.

Props

NameTypeDefaultDescription
idstring | undefined —

Root element id

modelValueboolean | undefined —

Whether tooltip is open

contentstring | undefined —

Tooltip content

maxContentWidthstring | number | undefined —

Maximum content width

colorstring | undefined —

Tooltip color

textColorstring | undefined —

Tooltip text color

placementUi3nTooltipPlacement | undefined"top"

Tooltip placement

triggerElementHTMLElement | Ui3nVirtualElement | undefined —

External element the tooltip is positioned against. When set, this node is the floating-ui reference and receives hover/click listeners.

positionStrategy"absolute" | "fixed" | undefined —

Position strategy

offsetXstring | number | undefined0

Offset X

offsetYstring | number | undefined0

Offset Y

trigger"click" | "hover" | "manual" | undefined"hover"

Trigger type

disabledboolean | undefinedfalse

Whether tooltip is disabled

Events

Event NameArguments / Value TypeDescription
update:modelValuevalue: boolean —
close —
open —
opened —
closed —

Slots

Slot NameScope Props (v-slot)Description
#default —

Default slot

#content —

Content slot

CSS Variables

Set any of these where you need it — on :root, on a container, or on the element itself through [data-ui3n] — and the component follows. Leave them alone and it uses the defaults below.

NameDefault
--ui3n-tooltip-arrow-size8px
--ui3n-tooltip-bg-colorvar(--color-bg-block-tritery-default)
--ui3n-tooltip-border-radius6px
--ui3n-tooltip-font-size11px
--ui3n-tooltip-line-height12px
--ui3n-tooltip-max-width400px
--ui3n-tooltip-padding6px 8px
--ui3n-tooltip-text-colorvar(--color-text-block-darkery-default)

Usage Examples ​

Simple tooltip ​

Simple tooltip

Basic tooltip on hover

Tooltip placements ​

Tooltip placements

Tooltips with different placements

Custom tooltip content ​

Custom tooltip content

Tooltip with custom content slot

External trigger element ​

External trigger element

Tooltip positioned against a DOM node passed via triggerElement

Manual tooltip on an external element ​

Manual tooltip on an external element

Open and close a tooltip next to an external node with v-model

Programmatic plugin ​

Install the plugin with app.use(tooltips), then call $tooltip.show(el, options) to open immediately or $tooltip.attach(el, options) to bind hover/click.

Programmatic plugin

show() opens immediately; attach() binds hover on the target