Skip to content

Popover

Displays richer content than Tooltip, commonly used for showing detailed information, form submissions, or user guidance.

Basic Usage

Quickly configure a standard card via title and content.

Basic Usage

Placement

Supports 12 directions of popup positioning.

Placement

Feature Alignment (Popconfirm)

Popover supports configuring structured content like Popconfirm, including icons, titles, and descriptions.

Feature Alignment Example

Triggers

Supports multiple trigger methods: hover, click, focus, contextmenu. Also supports combinations of triggers like ['hover', 'click'].

Triggers

Advanced Slot Content

Supports header, content, footer, and icon slots, enabling highly expressive complex UI.

Advanced Slot Content

Controlled Visibility

Use v-model:visible to manually control component state synchronization.

Manual Control

Use in Nuxt

Popover fully supports Nuxt 3/4 SSR rendering. When using in Nuxt projects, components are automatically imported without manual registration.

Use in Nuxt

SSR Notes:

  • ✅ Fully supports Server-Side Rendering (SSR) with no hydration errors
  • ✅ Automatically detects global dark mode
  • ✅ Supports all Props and Slots
  • ✅ Floating layer container automatically teleports to body to ensure correct z-index

SSR Transparency

The Popover component uses Backdrop-filter acrylic effect, which automatically degrades to solid color in SSR environment until client-side activation, ensuring optimal loading performance.

API

Props

PropDescriptionTypeDefault
titleTitlestring-
descriptionDescription text (same as Popconfirm)string-
iconIcon name (same as Popconfirm)string-
icon-colorIcon colorstring-
contentContent textstring-
placementPopup positionPlacement'bottom'
visibleManual control visibilityboolean | nullnull
triggerTrigger methodPopoverTrigger | PopoverTrigger[]'click'
effectTheme style'light' | 'dark''light'
disabledWhether to disablebooleanfalse
show-arrowWhether to show arrowbooleantrue
show-afterShow delay (ms)number0
hide-afterHide delay (ms)number100
offsetOffset[number, number][0, 12]
widthPopup widthstring | number'auto'
max-heightMax height (with scrollable)string | number'none'
scrollableWhether content is scrollablebooleanfalse
interactiveWhether to allow mouse entering popupbooleantrue
match-trigger-widthWhether to match trigger widthbooleanfalse
z-indexZ-indexnumber2003
teleportedWhether to mount to bodybooleantrue
popper-classPopup custom classstring-
popper-stylePopup custom styleCSSProperties{}
transitionAnimation namestring'yh-popover-fade'
persistentWhether to persist DOM on hidebooleantrue

Events

Event NameDescriptionParameters
update:visibleTriggered when visibility changes(visible: boolean)
showTriggered when shown-
hideTriggered when hidden-

Slots

Slot NameDescription
defaultTrigger element
headerCustom header/title content
contentCustom body content (overrides content prop)
iconCustom icon
footerCustom footer action area

Expose

NameDescriptionType
toggleManually toggle visibility(val: boolean) => void
visibleCurrent visibility stateRef<boolean>

Theme Variables (CSS Variables)

The component supports deep customization via CSS variables. All color variables are integrated with the global theme system, automatically supporting dark mode:

VariableDefaultDescription
--yh-popover-bgvar(--yh-bg-color-overlay)Popover background color (auto-switches in dark mode)
--yh-popover-bordervar(--yh-border-color-light)Border color
--yh-popover-textvar(--yh-text-color-primary)Primary text color
--yh-popover-text-secondaryvar(--yh-text-color-secondary)Secondary text color
--yh-popover-radiusvar(--yh-radius-lg)Popover border radius
--yh-popover-shadowvar(--yh-shadow-lg)Popover shadow
--yh-popover-title-sizevar(--yh-font-size-md)Title font size

Tip: Popover is deeply integrated with the underlying Tooltip engine, with excellent performance, supporting 12-direction popup and perfectly adapted to Nuxt SSR solution.

Released under the MIT License.