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
activebooleanForce active state
defaultIndexnumberPre-selected data index
trigger'hover' | 'click''hover'Activation trigger
sharedbooleantrueShow all series at index
cursorboolean | objecttrueShow/customize cursor
offsetnumberPixel offset from cursor
includeHiddenbooleanfalseShow hidden series data

Tooltip slots

SlotPropsDescription
#content{ active, payload, label, coordinate }Full tooltip content
#cursorCustom cursor element
Copyright © 2026