Popover (气泡卡片)

锚定在触发槽上的浮层面板。

基础用法

Basic.vue

位置

Placements.vue

箭头

Arrow.vue

富内容

RichContent.vue

悬停菜单(导航)

trigger="hover" + 共享 group = 导航悬停菜单。横向移到兄弟项**瞬间切换**; 下移到面板靠**坐标安全三角**不会中途关闭(且面板是 teleport 的也照样work);悬停**不抢焦点**; 点击 / 键盘 / Esc 仍可用,**触屏自动退回点击**。动作菜单(KunDropdown)仍只用点击。 若站点用 --kun-surface-opacity 全局磨砂了表面,给菜单加 opaque 保持实心可读 (直接在面板上写 --kun-surface-opacity:1 无效——主题色在 :root 解析)。

HoverMenu.vue

属性

属性类型默认值说明
ariaLabelstring
autoPositionbooleantrueAvoid viewport collisions: flip to the opposite side, shift along the edge, and cap height/width to the available space so tall content scrolls instead of overflowing. Default `true`. Set `false` to honour `position` verbatim.
closeDelaynumber120`trigger="hover"`: ms grace after leaving (crosses the gap). Default 120.
fullWidthbooleanfalseMake the trigger anchor span its container instead of shrinking to its content. Both wrapper divs switch from `inline-block` to `block w-full`, so a full-width trigger (e.g. a `fullWidth` KunButton or a split button) can actually fill the width. Default `false` (inline, content-width).
groupstringundefined`trigger="hover"`: shared id so a row of menus switches instantly between siblings and only one is open at a time (menu-bar behaviour).
innerClassstring""
opaquebooleanfalseForce a fully OPAQUE panel, ignoring a globally-lowered `--kun-surface-opacity` (which sites with a background image use to frost surfaces). Menus/popovers over a busy background usually want this for legibility. Default `false` (follows the global surface opacity). Note: setting `--kun-surface-opacity:1` on the panel yourself does NOT work — Tailwind resolves the themed colour at `:root`.
openDelaynumber100`trigger="hover"`: ms before a hover opens. Default 100.
positionKunPopoverPosition"bottom-start"
roundedKunUIRoundedundefined
showArrowbooleanfalse
trigger"click" | "hover""click"How the popover opens. `'click'` (default) toggles + moves focus into the panel. `'hover'` opens on mouse hover with a coordinate safe-triangle so you can reach the panel without it closing — for navigation menus. Hover never steals focus; click/keyboard/Esc still work, and touch falls back to click.