Tooltip

Short hint shown on hover or focus of the wrapped element. The size prop (xs, sm, md, lg, xl) sets the tooltip padding and text.

Jump to API reference

Import

Vue
import { UiTooltip } from '@ziyarago/ui/vue'

Default

Hover meCopy booking ID
Vue
<UiTooltip text="Copy booking ID">
  Hover me
</UiTooltip>

Several

Wi-FiFree Wi-FiShuttleShuttle to Haram
Vue
<UiTooltip text="Free Wi-Fi">
  Wi-Fi
</UiTooltip>

<UiTooltip text="Shuttle to Haram">
  Shuttle
</UiTooltip>

Sizes

Hover meCopy booking IDHover meCopy booking IDHover meCopy booking IDHover meCopy booking IDHover meCopy booking ID
Vue
<UiTooltip size="xs" text="Copy booking ID">
  Hover me
</UiTooltip>

<UiTooltip size="sm" text="Copy booking ID">
  Hover me
</UiTooltip>

<UiTooltip size="md" text="Copy booking ID">
  Hover me
</UiTooltip>

<UiTooltip size="lg" text="Copy booking ID">
  Hover me
</UiTooltip>

<UiTooltip size="xl" text="Copy booking ID">
  Hover me
</UiTooltip>

API reference

Short text bubble shown on hover or focus of the wrapped element; use for icon-only controls and hints.

Props

PropType and valuesDefaultDescription
textrequiredstring—Tooltip text.
placementtopbottomleftright'top'Side of the wrapped element where the bubble appears.
sizexssmmdlgxl'md'Scale of bubble padding and font.

Slots

Vue: named slots. React: a prop with the same name; default is children.

defaultThe element the tooltip is attached to.

Notes

  • Pure CSS bubble; it cannot contain markup. For rich content use HoverCard.
  • Escape hides the bubble while it is shown (hover or focus) without moving focus; it stays visible while the pointer is over the trigger or the bubble, and returns on the next hover or focus.