Popover

A floating panel for contextual UI, with flexible sizing, hover triggers, a controllable open state and nesting.

import { Popover, PopoverContent, PopoverTrigger } from "@plexui/vue/components/Popover";

Examples

Overview

Sizing the popover

Open on hover

Using the controller

Nesting

All floating UI components in Plex UI can be infinitely nested by relying on z-index: auto; and natural stacking order.

Additionally, esc keypresses are handled independently as a stacking order.

API

Popover (root)

PropTypeDefaultDescription
open / v-model:openboolean—Controlled open state; uncontrolled when omitted
@update:open(nextState: boolean) => void—Emitted when the popover opens or closes
show-on-hoverbooleanfalseOpen on hover and focus instead of click
hover-open-delaynumber150Delay before a hover popover opens (ms)

PopoverTrigger: Renders the element that toggles the popover. The trigger should be the user's point of interaction for revealing the popup. No specific props.

PopoverContent

PropTypeDefaultDescription
widthnumber | "auto""auto"Panel width in px
min-widthnumber | "auto"300Minimum panel width in px
max-widthnumber700Maximum panel width in px, capped by the space available in the viewport
side"top" | "right" | "bottom" | "left""bottom"Preferred placement; flips when it collides
align"start" | "center" | "end""center"Alignment relative to trigger
side-offsetnumber8Offset from trigger (px)
align-offsetnumber-5Offset from the start or end alignment (px)
avoid-collisionsbooleantrueReposition to stay inside the viewport and scroll containers
translucentbooleanfalseTranslucent, blurred surface
auto-focusbooleantrueMove focus into the panel when it opens (hover popovers never take focus)
classstring—Applied to the panel
default slot{ close, shake }—Panel content; receives the controller functions

usePopoverController(): Composable available in components inside PopoverContent. Returns { close: () => void, shake: () => void }, the same functions the content's default slot receives.

Styling

Popover reads these component tokens. Override them at any scope to restyle it:

  • --popover-radius: radius (default var(--radius-xl))