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.
<template>
<B24Popover>
<B24Button label="Open" />
<template #content>
<Placeholder class="size-48 m-4 inline-flex" />
</template>
</B24Popover>
</template>
Mode
Use the mode prop to change the mode of the Popover. Defaults to click.
<template>
<B24Popover mode="hover">
<B24Button label="Open" />
<template #content>
<Placeholder class="size-48 m-4 inline-flex" />
</template>
</B24Popover>
</template>
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.
<template>
<B24Popover mode="hover" :open-delay="500" :close-delay="300">
<B24Button label="Open" />
<template #content>
<Placeholder class="size-48 m-4 inline-flex" />
</template>
</B24Popover>
</template>
Content
Use the content prop to control how the Popover content is rendered, like its align or side for example.
<template>
<B24Popover
:content="{
align: 'center',
side: 'bottom',
sideOffset: 8
}"
>
<B24Button label="Open" />
<template #content>
<Placeholder class="size-48 m-4 inline-flex" />
</template>
</B24Popover>
</template>
Arrow
Use the arrow prop to display an arrow on the Popover.
<template>
<B24Popover arrow>
<B24Button label="Open" />
<template #content>
<Placeholder class="size-48 m-4 inline-flex" />
</template>
</B24Popover>
</template>
Modal
Use the modal prop to control whether the Popover blocks interaction with outside content. Defaults to false.
<template>
<B24Popover modal>
<B24Button label="Open" />
<template #content>
<Placeholder class="size-48 m-4 inline-flex" />
</template>
</B24Popover>
</template>
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.Entity info card
Real-world example: an account or deal summary shown in a hover popover, assembled from Card, Avatar, Separator, Button, Link and DescriptionList — no custom styling beyond the avatar accent.
Build an entity-info popover for any record or object.
Lean on the b24-ui-nuxt skill (see references/recipes/overlays.md → "Info popover (entity summary)") to build a compact entity-info popover that sits on top of an entity name in running text. The popover should tease the underlying record: a colored avatar, the entity title, a one-line caption, a primary CTA, a separator, and a label/value list with one or two values rendered as their own component (link, badge, time).
Before writing any code, gather the missing context:
- Which entity does the popover describe (e.g. user, account, order, ticket, project, product, event)? That decides the avatar icon and the design-token accent (
alert,success,warning,copilot). - What's the trigger — a
B24Linkmid-paragraph (hover) or a discrete control (click)? - Which fields belong on the card: title, caption (a short status line such as count, stage, or role), CTA label + target, plus 2-4 label/value pairs (owner, created-at, status, category, location, etc.)?
- Do any values need their own component (link, badge, time)? If yes, plan to use the global
#descriptionslot withv-if="item.slot === '<key>'"instead of replacing the whole<dt>/<dd>pair via a per-item slot. - Locale, dark-mode preview, and any analytics events to fire when the popover opens or the CTA is clicked.
Once those answers are in, assemble the popover from stock components only (B24Popover, B24Avatar, B24Button, B24Separator, B24DescriptionList, B24Link) and reach for the :b24ui prop to:
- pin the layout to a single column inside the narrow card and zero the row dividers,
- match the recipe's compact rhythm (
p-6,gap-4.5,w-65,size="sm"button), - recolor the avatar through design tokens — never inline hex values.
Use semantic typography utilities (text-label, text-description) for the title and caption, and keep all copy in the requested locale.
Sales dynamics widget
A real-world example of pairing a Popover with a stats card. The widget itself is documented on the Card page; here it sits inside B24Popover so a trigger button reveals it on demand.
Wrap the Sales dynamics widget in a Popover so a trigger button or link reveals it on demand.
Take the Sales dynamics widget recipe (see references/recipes/overlays.md → "Stats widget (KPI summary)") and surface it through B24Popover so a button or in-line link reveals the metrics on demand — useful in dashboard rows, list cells or running text where the full card would be too heavy.
Before writing any code, gather the missing context:
- What's the trigger — a
B24Button(discrete control, typicallymode="click") or aB24Link is-actionmid-paragraph (typicallymode="hover")? - Does the popover need to follow the cursor, attach to a custom
#anchor, or stay anchored to the trigger? - Should the popover stay open while the user interacts with the widget? If the widget's own
Configure/Feedbackbuttons must work without closing, keepdismissibleon its default (true) but ensure click handlers don't bubble to the popover root. - What's the data shape behind the rows (and the optional highlight row), and where does it come from — props on the page, a store, or an async fetch?
- Locale and analytics: track popover opens and CTA clicks separately, since this is a "peek" surface, not the canonical metrics page.
Once those answers are in, assemble the popover from stock components only:
- Strip the popover's content chrome with
:b24ui="{ content: 'p-0 bg-transparent border-0 shadow-none' }"so the widget paints its own surface (it carries the gradient, rounded corners and shadow internally). - Place the trigger in the default slot (
B24ButtonorB24Link is-action— never both in the same popover); setmodeto match the trigger affordance. - Render the widget itself inside
#contentexactly as documented in the recipe — theedge-darkroot, the purple radial gradient (--ui-color-copilot-bg-content-3 → -2 → -1), thestyle-filled-boosthighlight row and the threeair-secondary-accentaction buttons. - For an inline link trigger, anchor the popover with
:content="{ side: 'bottom', sideOffset: 8 }"so the widget hovers below the link without clipping the surrounding paragraph.
Keep all copy in the requested locale and surface the data through the same shape (title, totalLine, todayLine, rangeLabel, rows, highlight) used by the standalone recipe.
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 {
slots: {
content: 'base-mode bg-(--ui-color-bg-content-primary) shadow-(--popup-window-box-shadow) rounded-(--ui-border-radius-xl) 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-(--ui-color-bg-content-primary)'
}
}