Usage
Use a Button or any other component in the default slot of the Tooltip.
<template>
<B24Tooltip text="Open on GitHub">
<B24Button label="Open" />
</B24Tooltip>
</template>
App component which uses the TooltipProvider component from Reka UI.Text
Use the text prop to set the content of the Tooltip.
<template>
<B24Tooltip text="Open on GitHub">
<B24Button label="Open" />
</B24Tooltip>
</template>
Kbds
Use the kbds prop to render Kbd components in the Tooltip.
<template>
<B24Tooltip
text="Open on GitHub"
:kbds="{
'0': 'meta',
'1': 'G'
}"
>
<B24Button label="Open" />
</B24Tooltip>
</template>
meta that displays as ⌘ on macOS and Ctrl on other platforms.Delay
Use the delay-duration prop to change the delay before the Tooltip appears. For example, you can make it appear instantly by setting it to 0.
<template>
<B24Tooltip :delay-duration="0" text="Open on GitHub">
<B24Button label="Open" />
</B24Tooltip>
</template>
tooltip.delayDuration option in the App component.Content
Use the content prop to control how the Tooltip content is rendered, like its align or side for example.
tooltip.content option in the App component.<template>
<B24Tooltip
:content="{
align: 'center',
side: 'bottom',
sideOffset: 8
}"
text="Open on GitHub"
>
<B24Button label="Open" />
</B24Tooltip>
</template>
Arrow
Use the arrow prop to display an arrow on the Tooltip.
<template>
<B24Tooltip text="Open on GitHub">
<B24Button label="Open" />
</B24Tooltip>
</template>
Disabled
Use the disabled prop to disable the Tooltip.
<template>
<B24Tooltip disabled text="Open on GitHub">
<B24Button label="Open" />
</B24Tooltip>
</template>
Examples
Control open state
You can control the open state by using the default-open prop or the v-model:open directive.
defineShortcuts, you can toggle the Tooltip by pressing O.With following cursor
You can make the Tooltip follow the cursor when hovering over an element using the reference prop:
Help Icon
You can use the Icon and the Tooltip.
API
Props
Slots
Emits
Theme
export default {
slots: {
content: 'light flex flex-row items-center justify-between gap-[5px] will-change-[opacity] min-h-[37px] shadow-xl/20 select-none motion-safe:data-[state=delayed-open]:animate-[scale-in_100ms_ease-out] motion-safe:data-[state=closed]:animate-[scale-out_100ms_ease-in] p-[13px] ps-[26px] text-(length:--ui-font-size-lg)/[normal] font-[family-name:var(--ui-font-family-system)] bg-(--ui-color-bg-content-inapp) text-(--ui-color-base-8) rounded-[calc(var(--ui-border-radius-3xl)-2px)] ring ring-(--ui-color-bg-content-inapp) origin-(--reka-tooltip-content-transform-origin) pointer-events-auto',
arrow: 'fill-(--ui-color-bg-content-inapp) stroke-(--ui-color-bg-content-inapp)',
text: 'text-pretty max-w-[344px] min-w-[100px]',
kbds: "hidden lg:inline-flex items-center shrink-0 gap-0.5 not-first-of-type:before:content-[''] not-first-of-type:before:me-0.5",
kbdsSize: 'sm',
kbdsAccent: 'default'
}
}