Base JS behaviour

Popover

A light panel on the native Popover API with side/align placement; for detail cards and rich hints — it lives in the top layer, Esc or light dismiss closes it.

Real scenarios

The component as it is used in a product — not a specimen grid.

The domain monitor

Every row’s info button opens a detail card with side="bottom" and align="end" — right under the trigger. The panel lives in the top layer, Esc or an outside click closes it, and because it carries role=dialog with a label, screen readers know what opened. Tab reaches the trigger like any button.

Healthy api.nabu.shop
Degraded cdn.nabu.shop
Maintained panel.nabu.shop

A rich hint beside the setting

side="top" with align="start" drops the panel right onto the setting instead of the page’s end. Anything may live inside — here the quota’s own usage bar stands in the hint, so the number above and the explanation below never part ways.

Monthly bandwidth
64% — 128 GB of 200 GB used

The teammate card on a mention

In the team thread the mention itself is the trigger: side="end" opens the panel from the reading direction (it mirrors in RTL by itself) and align="start" keeps it flush with the message. Clicks on the buttons inside never close the panel — only Esc or an outside click does.

Kian Rostami 10:42 · #product
— the Aban invoice is ready; I uploaded it so the whole team can review it.

Important props

Important props
Prop Type Default What it does
side / align string bottom / center Panel placement around the trigger; side: top · bottom · start · end, align: start · center · end — it scales in from the trigger side and follows the text direction.
label string null The panel’s accessible name (role=dialog).
trigger / slot slot — The trigger slot takes the opening button or link (popovertarget and aria-expanded/controls are wired for you); the default slot is the panel body — interactive content included.

Snippet

<x-nx::popover side="bottom" align="end" label="جزئیات دامنه">
    <x-slot:trigger><x-nx::button variant="ghost" icon="info" icon-only aria-label="جزئیات" /></x-slot:trigger>
    <strong>api.nabu.shop</strong> — ۹۹٫۹۸٪ آپ‌تایم این ماه
</x-nx::popover>

<x-nx::popover side="end" align="start" label="کارت سارا محمدی">
    <x-slot:trigger><x-nx::button variant="link">@سارا</x-nx:button></x-slot:trigger>
    داخل پنل کنش هم می‌شود گذاشت؛ فقط Esc یا کلیک بیرون می‌بندد.
</x-nx:popover>