Skip to the content
Konstruktor UI

Feedback and overlays

Popover

A small panel that opens next to its button and does not block the page: filters, details, a short form. <kui-popover> wraps the button and a .kui-popover panel, following the WAI-ARIA disclosure pattern with a non-modal dialog.

<kui-popover> needs kui.js; the markup works without it as described below

Examples

A popover with a small form

Focus moves to the first field when it opens. Escape, a press outside or the button closes it, and focus returns to the button.

HTML
<kui-popover>
  <button class="kui-button" type="button"><svg class="kui-icon" aria-hidden="true"><use href="kit/icons.svg#bell"></use></svg><span>Remind me</span></button>
  <div class="kui-popover" role="dialog" aria-labelledby="popover-remind-title" hidden>
    <p class="kui-popover__title" id="popover-remind-title">Reminder for INV-2026-0142</p>
    <div class="kui-field">
      <label class="kui-label" for="popover-remind-when">When</label>
      <div class="kui-select"><select id="popover-remind-when"><option>Tomorrow at 9:00</option><option>In 3 days</option><option>On the due date</option></select></div>
    </div>
    <label class="kui-check"><input class="kui-checkbox" type="checkbox" checked><span>Also email the client</span></label>
    <div class="kui-actions kui-actions--end">
      <button class="kui-button kui-button--primary kui-button--sm" type="button">Set reminder</button>
    </div>
  </div>
</kui-popover>

Placement

placement is bottom-start (the default), bottom-end, top-start or top-end. The panel moves to the other side when there is no room, and it always stays on screen.

HTML
<kui-popover placement="bottom-end">
  <button class="kui-button kui-button--icon" type="button" aria-label="About this amount"><svg class="kui-icon" aria-hidden="true"><use href="kit/icons.svg#info"></use></svg></button>
  <div class="kui-popover" role="dialog" aria-labelledby="popover-amount-title" hidden>
    <p class="kui-popover__title" id="popover-amount-title">How the total is made</p>
    <dl class="kui-kv">
      <div><dt>Net</dt><dd>RSD 10,333.33</dd></div>
      <div><dt>VAT (PDV) 20%</dt><dd>RSD 2,066.67</dd></div>
      <div><dt>Total</dt><dd>RSD 12,400.00</dd></div>
    </dl>
  </div>
</kui-popover>
<kui-popover placement="top-start">
  <button class="kui-button" type="button"><svg class="kui-icon" aria-hidden="true"><use href="kit/icons.svg#users"></use></svg><span>3 people</span></button>
  <div class="kui-popover" role="dialog" aria-label="People on this task" hidden>
    <ul class="kui-stack kui-gap-2">
      <li>Milica Petrović</li>
      <li>Đorđe Stojanović</li>
      <li>Hannelore Schüßler-Brandenburger</li>
    </ul>
  </div>
</kui-popover>

Classes and attributes

<kui-popover placement>
Wraps a button and its panel. placement: bottom-start, bottom-end, top-start, top-end.
.kui-popover
The panel. Starts hidden. Give it role="dialog" and a name: aria-labelledby on its title, or aria-label.
.kui-popover__title
A bold first line, used as the panel’s name.
aria-expanded, aria-controls
Set on the button by the element.
open(), close(returnFocus), isOpen
Methods and a property.
kui-open, kui-close
Events.

Keyboard

Enter or Space
On the button, opens or closes the panel.
Tab
Moves through the panel. Leaving it closes it.
Escape
Closes the panel and returns focus to the button.

Accessibility

  • The button says whether the panel is open (aria-expanded) and which panel it opens (aria-controls).
  • The panel is not modal: the rest of the page stays reachable, and moving focus out closes it.
  • Where the browser supports it the panel is a native popover in the top layer, so no parent can clip it.
  • Keep a popover small. Anything with several steps belongs in a dialog.

Do and do not

Do

  • Use it for details or a few settings that belong to one control.
  • Give an icon-only button an aria-label that says what the panel shows.

Do not

  • Do not put a menu of actions in a popover; use the menu, which has arrow keys.
  • Do not open a popover on hover; use a tooltip for a few words.