kliping.pro
  • Docs
  • Explore
  • Builder
  • Directory
  • Colors
  • Typeset
Saved
Docs
  • Sections13
  • Installation5
  • Dark Mode4
  • Forms3
  • Registry6
  • Utilities2
  • More10
  • Components137
  • Accordion
  • Action Bar
  • AI Chat
  • AI Thread List
  • Alert
  • Alert Dialog
  • Angle Slider
  • Animated Grid Pattern
  • Aspect Ratio
  • Attachment
  • Avatar
  • Avatar Group
  • Badge
  • Badge Overflow
  • Banner
  • Border Beam
  • Breadcrumb
  • Bubble
  • Button
  • Button Group
  • Calendar
  • Card
  • Carousel
  • Chart
  • Checkbox
  • Checkbox Group
  • Chip
  • Circular Progress
  • Client Only
  • Collapsible
  • Color Picker
  • Color Swatch
  • Combobox
  • Combobox Advanced
  • Command
  • Compare Slider
  • Composition
  • Context Menu
  • Cropper
  • Data Grid
  • Data Table
  • Data Table Advanced
  • Date Picker
  • Dialog
  • Direction Provider
  • Dot Pattern
  • Drawer
  • Dropdown Menu
  • Editable
  • Empty
  • Field
  • File Upload
  • Form
  • FPS
  • Gauge
  • Hitbox
  • Hover Card
  • Input
  • Input Group
  • Input OTP
  • Item
  • Kanban
  • Kbd
  • Kbd Advanced
  • Key Value
  • Label
  • List
  • Listbox
  • Logos
  • Map
  • Marker
  • Marquee
  • Mask Input
  • Masonry
  • Media Player
  • Mention
  • Menubar
  • Message
  • Message Scroller
  • Native Select
  • Navigation Menu
  • Number Field
  • Pagination
  • Particles
  • Pending
  • Phone Input
  • Pin Input
  • Popover
  • Portal
  • Presence
  • Progress
  • QR Code
  • Questionnaire
  • Radio Group
  • Range Calendar
  • Rating
  • Relative Time Card
  • Resizable
  • Responsive Dialog
  • Scroll Area
  • Scroll Spy
  • Scroller
  • Segmented Input
  • Select
  • Selection Toolbar
  • Separator
  • Sheet
  • Sidebar
  • Skeleton
  • Slider
  • Software Purchase Card
  • Sonner
  • Sortable
  • Speed Dial
  • Spinner
  • Stack
  • Stat
  • Status
  • Stepper
  • Stepper Advanced
  • Swap
  • Switch
  • Table
  • Tabs
  • Tags Input
  • Tags Input Advanced
  • Textarea
  • Time Picker
  • Timeline
  • Toast
  • Toggle
  • Toggle Group
  • Tooltip
  • Tour
  • Typography
  • Visually Hidden
  • Visually Hidden Input
  1. Docs
  2. Components
  3. Tooltip

Tooltip

PreviousNext

Kotak kecil berisi keterangan sebuah elemen, muncul saat elemen itu di-hover atau menerima fokus keyboard.

View 7 variants
Docs API Reference

Installation ​

pnpm dlx kliping@latest add tooltip

Pasang dependensi berikut:

pnpm add reka-ui

Salin dan tempel kode sumber di GitHub ke project Anda.

Sesuaikan path import dengan struktur project Anda.

Usage ​

vue
<script setup lang="ts">
import {
  Tooltip,
  TooltipContent,
  TooltipProvider,
  TooltipTrigger,
} from '@/components/ui/tooltip'
</script>

<template>
  <TooltipProvider>
    <Tooltip>
      <TooltipTrigger>Hover</TooltipTrigger>
      <TooltipContent>
        <p>Add to library</p>
      </TooltipContent>
    </Tooltip>
  </TooltipProvider>
</template>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

Requirements ​

Semua dipasang otomatis oleh kliping add; tabel ini untuk Anda yang memasang manual atau memeriksa project.

RequirementValue
ProjectVue 3.5+, Tailwind CSS v4, alias @ — disiapkan kliping init
npm packages@vueuse/core@^14.4.0, reka-ui@^2.10.3
Filescomponents/ui/tooltip/tooltip.vue
components/ui/tooltip/tooltip-content.vue
components/ui/tooltip/tooltip-provider.vue
components/ui/tooltip/tooltip-trigger.vue
components/ui/tooltip/index.ts

Anatomy ​

Susunan bagiannya seperti dipakai di contoh-contoh di atas. Impor semua bagian dari satu tempat, lalu susun begini:

vue
<Tooltip>
  <TooltipTrigger />
  <TooltipContent />
</Tooltip>
<TooltipProvider>
  <Tooltip>
    <TooltipTrigger />
    <TooltipContent />
  </Tooltip>
</TooltipProvider>

API Reference ​

Tooltip ​

PropTypeDefaultDescription
defaultOpen?boolean—The open state of the tooltip when it is initially rendered. Use when you do not need to control its open state.
open?boolean—The controlled open state of the tooltip.
delayDuration?number—Override the duration given to the Provider to customise the open delay for a specific tooltip.
disableHoverableContent?boolean—Prevents Tooltip.Content from remaining open when hovering. Disabling this has accessibility consequences. Inherits from Tooltip.Provider.
disableClosingTrigger?boolean—When true, clicking on trigger will not close the content.
disabled?boolean—When true, disable tooltip
ignoreNonKeyboardFocus?boolean—Prevent the tooltip from opening if the focus did not come from the keyboard by matching against the :focus-visible selector. This is useful if you want to avoid opening it when switching browser tabs or closing a dialog.
EventPayloadDescription
@update:open[value: boolean]Emitted when the open state changes.
SlotProps
#default{ open: boolean; }
Data attributeValue
[data-slot]"tooltip"

TooltipContent ​

PropTypeDefaultDescription
forceMount?boolean—Used to force mounting when more control is needed. Useful when controlling animation with Vue animation libraries.
ariaLabel?string—By default, screenreaders will announce the content inside the component. If this is not descriptive enough, or you have content that cannot be announced, use aria-label as a more descriptive label.
asChild?boolean—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
as?AsTag | Component—The element or component this component should render as. Can be overwritten by asChild.
align?"start" | "end" | "center"—The preferred alignment against the trigger. May change when collisions occur.
side?"bottom" | "top" | "right" | "left"—The preferred side of the trigger to render against when open. Will be reversed when collisions occur and avoidCollisions is enabled.
sideOffset?number4The distance in pixels from the trigger.
alignOffset?number—An offset in pixels from the start or end alignment options.
avoidCollisions?boolean—When true, overrides the side and align preferences to prevent collisions with boundary edges.
collisionBoundary?Element | (Element | null)[]—The element used as the collision boundary. By default this is the viewport, though you can provide additional element(s) to be included in this check.
collisionPadding?number | Partial<Record<"bottom" | "top" | "right" | "left", number>>—The distance in pixels from the boundary edges where collision detection should occur. Accepts a number (same for all sides), or a partial padding object, for example: { top: 20, left: 20 }.
arrowPadding?number—The padding between the arrow and the edges of the content. If your content has border-radius, this will prevent it from overflowing the corners.
sticky?"partial" | "always"—The sticky behavior on the align axis. partial will keep the content in the boundary as long as the trigger is at least partially in the boundary whilst "always" will keep the content in the boundary regardless.
hideWhenDetached?boolean—Whether to hide the content when the trigger becomes fully occluded.
positionStrategy?"fixed" | "absolute"—The type of CSS position property to use.
updatePositionStrategy?"always" | "optimized"—Strategy to update the position of the floating element on every animation frame.
EventPayloadDescription
@escapeKeyDown[event: KeyboardEvent]Emitted when Escape is pressed; call event.preventDefault() to keep it open.
@pointerDownOutside[event: Event]Emitted on a pointer down outside; call event.preventDefault() to keep it open.
SlotProps
#default—
Data attributeValue
[data-slot]"tooltip-content"

TooltipProvider ​

PropTypeDefaultDescription
delayDuration?number0The duration from when the pointer enters the trigger until the tooltip gets opened.
skipDelayDuration?number—How much time a user has to enter another trigger without incurring a delay again.
disableHoverableContent?boolean—When true, trying to hover the content will result in the tooltip closing as the pointer leaves the trigger.
disableClosingTrigger?boolean—When true, clicking on trigger will not close the content.
disabled?boolean—When true, disable tooltip
ignoreNonKeyboardFocus?boolean—Prevent the tooltip from opening if the focus did not come from the keyboard by matching against the :focus-visible selector. This is useful if you want to avoid opening it when switching browser tabs or closing a dialog.
content?TooltipContentProps—Default settings that will be used by all tooltip components.
SlotProps
#default—

TooltipTrigger ​

PropTypeDefaultDescription
reference?ReferenceElement—The reference (or anchor) element that is being referred to for positioning. If not provided will use the current component as anchor.
asChild?boolean—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
as?AsTag | Component—The element or component this component should render as. Can be overwritten by asChild.
SlotProps
#default—
Data attributeValue
[data-slot]"tooltip-trigger"

Keyboard Interactions ​

Perilaku keyboard-nya datang dari primitif Reka UI Tooltip yang dipakai komponen ini, mengikuti pola WAI-ARIA.

KeyDescription
TabOpens/closes the tooltip without delay.
SpaceIf open, closes the tooltip without delay.
EnterIf open, closes the tooltip without delay.
EscapeIf open, closes the tooltip without delay.

CSS Variables ​

Token tema yang dibaca komponen ini — ubah nilainya di CSS global (:root dan .dark, lihat Theming) untuk mengubah tampilannya tanpa menyentuh komponennya: --background, --foreground, --radius.

Credits ​

Berasal dari shadcn-vue (MIT, Copyright (c) 2023 unovue). Rantai lengkapnya di Credits.

PreviousToggle GroupNext Tour

On This Page

InstallationUsageRequirementsAnatomyAPI ReferenceTooltipTooltipContentTooltipProviderTooltipTriggerKeyboard InteractionsCSS VariablesCredits

© 2026 Kliping. Free components are open source under the MIT License.

LicenseCreditsRoadmap