FleetbaseFleetbase

Attach::Popover

<Attach::Popover> renders a floating layer attached to its parent — used for popovers, dropdown menus, and click-triggered floating UIs.

<Attach::Popover>

<Attach::Popover> renders a floating layer attached to its parent element. Unlike <Attach::Tooltip> (which is configured for transient hover hints), the Popover is configured for richer interactions — click triggers, persistent visibility, and @interactive content the user can mouse into.

It uses <Floating> under the hood for positioning.

Basic Usage

Place the Popover inside the element it should attach to:

<button class="btn btn-default">
  <FaIcon @icon="ellipsis" />
  <Attach::Popover @showOn="click" @hideOn="clickout escapekey">
    <div class="bg-white p-4 rounded shadow-lg">
      <h4 class="font-semibold mb-2">Quick actions</h4>
      <Button @text="Edit"   @onClick={{this.edit}} />
      <Button @text="Delete" @type="danger" @onClick={{this.delete}} />
    </div>
  </Attach::Popover>
</button>

Differences from <Attach::Tooltip>

TooltipPopover
Default @showOnmouseenter focusmouseenter focus
Default @hideOnmouseleave blur escapekeymouseleave blur escapekey
Default @placementtoptop
Default @interactivefalsefalse
Default @animationfillfill

The components have similar defaults — but Popover is the lower-level building block. Tooltip is a thin wrapper that also adds @class="ember-attacher-tooltip" and @ariaRole="tooltip".

For real popovers (click-triggered, persistent, interactive), override the defaults:

<Attach::Popover
  @showOn="click"
  @hideOn="clickout escapekey"
  @interactive={{true}}
  @placement="bottom-end"
  @arrow={{true}}
>
  {{!-- popover content --}}
</Attach::Popover>

Imperative Show/Hide

Use @isShown for full programmatic control:

<Attach::Popover @isShown={{this.popoverOpen}}>
  {{!-- ... --}}
</Attach::Popover>

<Button @text="Toggle popover" @onClick={{toggle this 'popoverOpen'}} />

Pair this with @showOn / @hideOn set to empty strings if you want to suppress the default event triggers.

Lazy Rendering

For expensive content (heavy charts, big tables), enable @lazyRender:

<Attach::Popover @lazyRender={{true}}>
  <ExpensiveChart />
</Attach::Popover>

The chart only renders the first time the popover is shown.

Arguments

ArgumentTypeDefaultDescription
@placementstringtoptop, bottom, left, right, plus -start / -end variants
@arrowbooleanfalseRender an arrow pointing at the parent
@offsetnumberDistance from the parent in px
@shiftOptionsobjectFloating-UI shift middleware options
@animationstringfillAnimation — fill, scale, slide, none
@hideOnstringmouseleave blur escapekeySpace-separated events to hide on. Common: clickout
@showOnstringmouseenter focusSpace-separated events to show on. Common: click
@interactivebooleanfalseAllow the user to mouse into the popover without it closing
@isShownbooleanImperative show/hide
@lazyRenderbooleanfalseDon't render until first show
@showDelaynumber0Show delay in ms
@hideDelaynumber0Hide delay in ms
@showDurationnumber300Show animation duration
@hideDurationnumber300Hide animation duration
@transitionDurationnumber0Transition duration
@renderInPlacebooleanfalseRender in DOM order instead of via a portal
@flipobjectFloating-UI flip middleware options
@modifiersarrayAdditional Floating-UI middleware
@useCapturebooleanfalseUse capture phase for event listeners
@onChange(isShown)Called when the popover toggles
@classNamesstringExtra classes on the popover wrapper

Common Trigger Patterns

Pattern@showOn@hideOn@interactive
Hover tooltipmouseenter focusmouseleave blur escapekeyfalse
Click menuclickclickout escapekeytrue
Hover popover (mouse can enter)mouseenter focusmouseleave blur escapekeytrue
Manual control"" (empty)"" (empty)as needed

See Also

Source

Attach::Popover | Fleetbase