Components

Tooltip

Configure tooltips for displaying data on hover

The <Tooltip> component displays data values when users hover over chart elements.

Add a tooltip

Place <Tooltip> inside any chart container:

<BarChart :width="500" :height="300" :data="data">
  <Bar data-key="value" fill="#8884d8" />
  <Tooltip />
</BarChart>

Customize tooltip content

Use the #content slot for full control:

<Tooltip>
  <template #content="{ active, payload, label }">
    <div v-if="active && payload?.length" class="bg-background border rounded p-2 shadow">
      <p class="font-medium">{{ label }}</p>
      <p v-for="entry in payload" :key="entry.dataKey" :style="{ color: entry.color }">
        {{ entry.name }}: {{ entry.value }}
      </p>
    </div>
  </template>
</Tooltip>

Pre-select a tooltip index

Use default-index to show a tooltip on initial render:

<Tooltip :default-index="1" />

Activate on click

<Tooltip trigger="click" />

Disable the cursor

<Tooltip :cursor="false" />

Tooltip props

PropTypeDefaultDescription
activebooleanundefinedForce active state. true keeps tooltip visible, false hides it, undefined lets the chart control visibility.
defaultIndexnumber | string | nullPre-selected data index shown on initial render
trigger'hover' | 'click''hover'Activation trigger
sharedbooleanundefinedShow all series at hovered index. When undefined, defaults to true for axis-type charts.
cursorboolean | objecttrueShow/customize cursor. Pass an object to set SVG attrs on the cursor element.
offsetnumber10Pixel offset from cursor
includeHiddenbooleanfalseShow hidden series data
filterNullbooleantrueFilter out entries with null values
isAnimationActivebooleantrueAnimate tooltip position changes
allowEscapeViewBox{ x: boolean, y: boolean }{ x: false, y: false }Allow tooltip to overflow the chart area
position{ x?: number, y?: number }Pin tooltip to a fixed position
reverseDirection{ x: boolean, y: boolean }{ x: false, y: false }Flip tooltip placement direction
portalHTMLElementTeleport tooltip to a custom DOM element
payloadUniqByboolean | FunctionDeduplicate payload entries
axisIdstring | number0Target axis ID for tooltip interaction
contentStyleobject{}Inline styles for tooltip content wrapper
labelStyleobject{}Inline styles for the label
itemStyleobject{}Inline styles for each payload item
itemSorterstring'name'Sort payload items. Accepts 'name', 'value', or 'dataKey'.
separatorstring' : 'Separator between name and value in default content
styleobject{}Inline styles for the tooltip bounding box

Tooltip slots

SlotPropsDescription
#content{ active, payload, label, coordinate, accessibilityLayer }Full tooltip content
#cursorShape-specific SVG propsCustom cursor element. Receives Cross props for ScatterChart, Rectangle props for BarChart, Sector props for radial charts, Curve props for others.
Copyright © 2026