Popover
Shows information in a portal that doesnt disturb the page layout.
Trigger Click
<script setup lang="ts">
import { Button, Popover } from 'frappe-ui'
</script>
<template>
<Popover>
<template #target="{ togglePopover }">
<Button @click="togglePopover()">Click me</Button>
</template>
<template #body-main>
<div class="p-2 text-ink-gray-9">Popover content</div>
</template>
</Popover>
</template>Trigger Hover
<script setup lang="ts">
import { Button, Popover } from 'frappe-ui'
</script>
<template>
<Popover trigger="hover" :hover-delay="0.5">
<template #target>
<Button>Hover me</Button>
</template>
<template #body-main>
<div class="p-2 text-ink-gray-9">Popover content</div>
</template>
</Popover>
</template>API Reference
Show types
export interface PopoverProps {
/** Controls visibility of the popover */
show?: boolean
/** Event that triggers the popover */
trigger?: 'click' | 'hover'
/** Delay in ms before showing popover on hover */
hoverDelay?: number
/** Delay in ms before hiding popover on hover leave */
leaveDelay?: number
/** Placement of the popover relative to the target */
placement?:
| 'top-start'
| 'top-end'
| 'bottom-start'
| 'bottom-end'
| 'right-start'
| 'right-end'
| 'left-start'
| 'left-end'
| 'top'
| 'bottom'
| 'right'
| 'left'
popoverClass?: string | object | Array<string | object>
/** Transition style to use */
transition?: 'default' | null
/** Whether to hide the popover when clicking outside */
hideOnBlur?: boolean
/** Whether the popover width should match the target element */
matchTargetWidth?: boolean
offset?: number
collisionPadding?: number
}Controls visibility of the popover
Event that triggers the popover
Delay in ms before showing popover on hover
Delay in ms before hiding popover on hover leave
Placement of the popover relative to the target
Transition style to use
Whether to hide the popover when clicking outside
Whether the popover width should match the target element
| Slot | Payload |
|---|---|
target | { togglePopover: () => void; updatePosition: () => void; open: () => void; close: () => void; isOpen Content of the trigger/anchor element |
body | { togglePopover: () => void; updatePosition: () => void; open: () => void; close: () => void; isOpen Main content of the popover body |
body-main | { togglePopover: () => void; updatePosition: () => void; open: () => void; close: () => void; isOpen Inner content inside the default body container |
Content of the trigger/anchor element
Main content of the popover body
Inner content inside the default body container
| Event | Payload |
|---|---|
open | [] Fired when the component opens. |
update:show | [value: boolean] Fired when the show changes. |
close | [] Fired when the component closes. |
Fired when the component opens.
Fired when the show changes.
Fired when the component closes.