Skip to content
↑↓ to navigate↵ to openesc to close

Menu

Popover

Morph Popover

PopoverMorph.vue

Install

Run it in a project set up with shadcn-vue. The source is copied to components/beui and its dependencies are added to your package.json. Read the shadcn-vue guide

bunx --bun shadcn-vue@latest add @beui-vue/popover-morph

Import the shared styles once in your application.

TSUsage
import PopoverMorph from '@/components/beui/controls/popover/PopoverMorph.vue'
import '@/components/beui/styles.css'

API Reference

MorphPopover

v-model:open?
boolean | undefined

Controlled open state.

Default—
defaultOpen?
boolean

Uncontrolled initial open state.

Defaultfalse
class?
string
Default—
side?
"top" | "bottom"
Defaultbottom
align?
"start" | "end"
Defaultstart
sideOffset?
number

Gap between trigger and panel, in px.

Default8
radius?
number

Panel corner radius, in px.

Default16
shadow?
boolean

Draw the surface shadow.

Defaulttrue
label?
string

Built-in trigger text and fallback panel name.

Default—
asChild?
boolean

Use the `#trigger` slot's own element as the trigger instead of a built-in button.

Default—
contentClass?
string
Default—
contentStyle?
StyleValue
Default—
onOpenAutoFocus?
(content: HTMLElement) => void

Runs after the portalled surface is positioned and visible. Passing it hands focus to the caller.

Default—
initialFocus?
HTMLElement | null | (() => HTMLElement | null)

Element to focus when a keyboard open shows the panel. Defaults to the first focusable element.

Default—
#trigger?
slot

The trigger. With `asChild` its own element is the trigger; otherwise it is the label of the built-in button.

Default—
#default?
{ close: () => void }

Panel content, or `MorphPopoverTrigger` and `MorphPopoverContent` when composed from parts. `close` shuts the popover.

Default—

MorphPopoverContent

side?
"top" | "bottom"
Default—
align?
"start" | "end"
Default—
sideOffset?
number

Gap between trigger and panel, in px.

Default—
radius?
number

Panel corner radius, in px.

Default—
shadow?
boolean

Draw the surface shadow.

Defaultundefined
onOpenAutoFocus?
(content: HTMLElement) => void

Runs after the portalled surface is positioned and visible. Passing it hands focus to the caller.

Default—
initialFocus?
HTMLElement | null | (() => HTMLElement | null)

Element that takes focus when the panel opens from the keyboard; falls back to the first focusable control.

Default—
class?
string
Default—
#default?
{ close: () => void }

Panel content. `close` shuts the popover.

Default—

Updated