Usage
Use a Button or any other component in the default slot of the Tooltip.
{
"wait": "Loading client-side content..."
}App component which uses the TooltipProvider component from Reka UI.Text
Use the text prop to set the content of the Tooltip.
{
"wait": "Loading client-side content..."
}Kbds
Use the kbds prop to render Kbd components in the Tooltip.
{
"wait": "Loading client-side content..."
}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.
{
"wait": "Loading client-side content..."
}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.
{
"wait": "Loading client-side content..."
}Arrow
Use the arrow prop to display an arrow on the Tooltip.
{
"wait": "Loading client-side content..."
}Disabled
Use the disabled prop to disable the Tooltip.
{
"wait": "Loading client-side content..."
}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 defineAppConfig({
b24ui: {
tooltip: {
slots: {
content: 'dark 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-[10px] text-(length:--ui-font-size-sm)/(--ui-font-line-height-reset) font-[family-name:var(--ui-font-family-primary)] bg-(--ui-color-bg-content-primary)/80 text-(--ui-color-design-plain-na-focused-content) rounded-[calc(var(--popup-window-border-radius)-2px)] origin-(--reka-tooltip-content-transform-origin) pointer-events-auto',
arrow: 'fill-(--ui-color-bg-content-primary)/80',
text: 'text-pretty max-w-[200px] 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'
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import bitrix24UIPluginVite from '@bitrix24/b24ui-nuxt/vite'
export default defineConfig({
plugins: [
vue(),
bitrix24UIPluginVite({
b24ui: {
tooltip: {
slots: {
content: 'dark 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-[10px] text-(length:--ui-font-size-sm)/(--ui-font-line-height-reset) font-[family-name:var(--ui-font-family-primary)] bg-(--ui-color-bg-content-primary)/80 text-(--ui-color-design-plain-na-focused-content) rounded-[calc(var(--popup-window-border-radius)-2px)] origin-(--reka-tooltip-content-transform-origin) pointer-events-auto',
arrow: 'fill-(--ui-color-bg-content-primary)/80',
text: 'text-pretty max-w-[200px] 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'
}
}
}
})
]
})