Usage
Use a Button or any other component in the default slot of the Popover.
Then, use the #content slot to add the content displayed when the Popover is open.
{
"wait": "Loading client-side content..."
}Mode
Use the mode prop to change the mode of the Popover. Defaults to click.
{
"wait": "Loading client-side content..."
}Delay
When using the hover mode, you can use the open-delay and close-delay props to control the delay before the Popover is opened or closed.
{
"wait": "Loading client-side content..."
}Content
Use the content prop to control how the Popover content is rendered, like its align or side for example.
{
"wait": "Loading client-side content..."
}Arrow
Use the arrow prop to display an arrow on the Popover.
{
"wait": "Loading client-side content..."
}Modal
Use the modal prop to control whether the Popover blocks interaction with outside content. Defaults to false.
{
"wait": "Loading client-side content..."
}Dismissible
Use the dismissible prop to control whether the Popover is dismissible when clicking outside of it or pressing escape. Defaults to true.
close:prevent event will be emitted when the user tries to close it.Examples
Control open state
You can control the open state by using the default-open prop or the v-model:open directive.
defineShortcuts, you can toggle the Popover by pressing O.With command palette
You can use a CommandPalette component inside the Popover's content.
With following cursor
You can make the Popover follow the cursor when hovering over an element using the reference prop:
With anchor slot
You can use the #anchor slot to position the Popover against a custom element.
mode is click.API
Props
Slots
close function is only available when mode is set to click because Reka UI exposes this for Popover but not for HoverCard.Emits
Theme
export default defineAppConfig({
b24ui: {
popover: {
slots: {
content: 'light bg-(--popup-window-background-color) shadow-(--popup-window-box-shadow) rounded-(--popup-window-border-radius) will-change-[opacity] motion-safe:data-[state=open]:animate-[scale-in_100ms_ease-out] motion-safe:data-[state=closed]:animate-[scale-out_100ms_ease-in] origin-(--reka-popover-content-transform-origin) focus:outline-none pointer-events-auto',
arrow: 'fill-(--popup-window-background-color)'
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import bitrix24UIPluginVite from '@bitrix24/b24ui-nuxt/vite'
export default defineConfig({
plugins: [
vue(),
bitrix24UIPluginVite({
b24ui: {
popover: {
slots: {
content: 'light bg-(--popup-window-background-color) shadow-(--popup-window-box-shadow) rounded-(--popup-window-border-radius) will-change-[opacity] motion-safe:data-[state=open]:animate-[scale-in_100ms_ease-out] motion-safe:data-[state=closed]:animate-[scale-out_100ms_ease-in] origin-(--reka-popover-content-transform-origin) focus:outline-none pointer-events-auto',
arrow: 'fill-(--popup-window-background-color)'
}
}
}
})
]
})