Popover composes a panel component and a trigger directive.

popover.ts
import { KuiButtonDirective, KuiPopoverComponent, KuiPopoverForDirective } from '@kikita-labs/ui';

Wire any element as a trigger with [kuiPopoverFor], then project arbitrary content into the panel.

<div class="basic-popover-example">
  <button [kuiPopoverFor]="myPop" kuiButton type="button">Open</button>

  <kui-popover #myPop placement="bottom" [arrow]="true" ariaLabel="Details">
    <div class="kui-popover-title">Title</div>
    <div class="kui-popover-desc">Supporting text.</div>
  </kui-popover>
</div>

Projected content is developer-provided, including buttons that call the popover's own close() method.

<div class="action-popover-example">
  <button [kuiPopoverFor]="confirmPop" kuiButton type="button" appearance="danger">Delete</button>

  <kui-popover
    #confirmPop
    placement="bottom"
    align="start"
    [arrow]="true"
    ariaLabel="Delete record"
  >
    <div class="kui-popover-title">Delete record?</div>
    <div class="kui-popover-desc" style="margin-bottom: 12px">This cannot be undone.</div>
    <div style="display: flex; gap: 8px; justify-content: flex-end">
      <button kuiButton type="button" shape="outline" size="sm" (click)="confirmPop.close()">
        Cancel
      </button>
      <button
        kuiButton
        type="button"
        appearance="danger"
        size="sm"
        (click)="delete(); confirmPop.close()"
      >
        Delete
      </button>
    </div>
  </kui-popover>

  @if (deleted()) {
    <span class="action-popover-example__status">Record deleted.</span>
  }
</div>

triggerType="hover" opens on mouseenter and closes after hoverDelay, so the mouse can travel from trigger to panel.

<div class="hover-popover-example">
  <button [kuiPopoverFor]="hoverPop" kuiButton type="button">Hover me</button>

  <kui-popover
    #hoverPop
    placement="top"
    triggerType="hover"
    [arrow]="true"
    ariaLabel="Hover details"
  >
    <div class="kui-popover-desc">Opens on hover. Mouse can travel to the panel.</div>
  </kui-popover>
</div>

Inputs verified against @kikita-labs/ui v1.6.1 v1.6.1 public typings.

NameTypeDefaultDescription
placement'top' | 'bottom' | 'left' | 'right''bottom'Preferred side of the anchor. Auto-flips to the opposite side to fit the viewport.
align'start' | 'center' | 'end''center'Alignment of the panel along the anchor edge. Preserved after a placement flip.
arrowbooleanfalseShows the arrow caret pointing to the anchor.
triggerType'click' | 'hover''click'click toggles the panel on click and closes on outside click or ESC. hover opens on mouseenter and closes on mouseleave.
ariaLabelstring'Popover'Accessible name for the role="dialog" panel. Prefer content-specific text.
hoverDelaynumber100Delay in ms before closing on mouseleave in hover mode. Lets the mouse travel from trigger to panel.
offsetnumber8Gap in px between the anchor and the panel. The arrow adds 6px automatically.
trapFocusbooleanfalseTraps focus inside the panel and auto-focuses the first focusable element on open.
openboolean (model)falseCurrent open state exposed for trigger integrations via openChange. Not intended as a standalone controlled API.
[kuiPopoverFor]KuiPopoverComponent | undefined-Wires any element as a trigger for a kui-popover. Sets aria-expanded and aria-haspopup="dialog" automatically.
.kui-popover-title--Optional CSS class for a semi-bold sm title inside the projected content.
.kui-popover-desc--Optional CSS class for secondary sm supporting text inside the projected content.
--kui-popover-bgCSS custom propertyvar(--kui-color-surface-elevated)Panel background.
--kui-popover-borderCSS custom propertyvar(--kui-color-border)Panel border color.
--kui-popover-radiusCSS custom propertyvar(--kui-radius-lg)Panel corner radius.
--kui-popover-shadowCSS custom propertyvar(--kui-shadow-lg)Panel drop shadow.
--kui-popover-padding-xCSS custom propertyvar(--kui-space-4)Panel horizontal padding.
--kui-popover-padding-yCSS custom propertyvar(--kui-space-4)Panel vertical padding.
--kui-popover-min-widthCSS custom property160pxMinimum panel width.
--kui-popover-max-widthCSS custom property320pxMaximum panel width.
--kui-popover-arrow-sizeCSS custom property10pxArrow caret size.
--kui-z-popoverCSS custom property400Panel z-index, between Dropdown (300) and Dialog (500).

Popover exposes dialog semantics and returns focus to the trigger on close.

  • The panel renders role="dialog" with aria-label set from ariaLabel. Prefer content-specific text over the default 'Popover'.
  • [kuiPopoverFor] sets aria-expanded and aria-haspopup="dialog" on the trigger automatically.
  • Click mode: Escape or an outside click closes the panel and returns focus to the trigger.
  • Hover mode: mouseenter on the trigger opens the panel; mouseleave starts a hoverDelay timer that a mouseenter on the panel cancels.
  • Set [trapFocus]="true" when the panel contains a form or multiple interactive elements that need focus contained inside the panel while open.
  • Popover covers keyboard dismissal, ARIA dialog semantics, and focus return. Full screen reader and other assistive-technology verification has not been completed for this primitive yet; see state-coverage.md in the library repository for current review status.