Skip to content

Popup ​

flint-popup

  • Tag: <flint-popup>
  • Class: FlintPopup

Import ​

ts
import '@getufy/flint-ui'; // auto-registers all
// or
import { FlintPopup } from '@getufy/flint-ui';

Usage ​

html
<flint-popup></flint-popup>

Properties ​

PropertyAttributeTypeDefaultDescription
activeactivebooleanfalseActivates positioning. When false, Floating UI listeners are torn down.
anchoranchorstring | Element''The anchor element. Pass a CSS selector string (resolved from ownerDocument),
placementplacementPlacement'top'Preferred placement of the popup relative to its anchor.
strategystrategyStrategy'absolute'CSS positioning strategy. Use 'fixed' to escape overflow containers.
distancedistancenumber0Distance from the anchor on the main axis (px).
skiddingskiddingnumber0Offset along the cross axis (px).
flipflipbooleanfalseFlip the popup when it would overflow the boundary.
flipFallbackPlacementsflip-fallback-placementsstring''Space-separated fallback placements when flipping (e.g. "bottom-start bottom-end").
flipBoundaryflipBoundaryElement | Element[] | undefined—Boundary element(s) for the flip middleware.
flipPaddingflip-paddingnumber0Padding from the flip boundary (px).
shiftshiftbooleanfalseShift the popup to stay within the boundary.
shiftBoundaryshiftBoundaryElement | Element[] | undefined—Boundary element(s) for the shift middleware.
shiftPaddingshift-paddingnumber0Padding from the shift boundary (px).
autoSizeauto-size'' | 'horizontal' | 'vertical' | 'both'''Constrain popup dimensions to available space: 'horizontal', 'vertical', or 'both'.
autoSizeBoundaryautoSizeBoundaryElement | Element[] | undefined—Boundary element(s) for auto-size.
autoSizePaddingauto-size-paddingnumber0Padding from the auto-size boundary (px).
syncsync'' | 'width' | 'height' | 'both'''Sync popup width, height, or both to match the anchor element.
arrowarrowbooleanfalseShow the built-in arrow pointing toward the anchor.
arrowPaddingarrow-paddingnumber4Arrow padding from the edges of the popup (px).
hoverBridgehover-bridgebooleanfalseRender a transparent bridge between anchor and popup for safe hover transitions.

Events ​

EventDetailDescription
flint-reposition&#123; placement &#125;Fired after the popup is repositioned. detail: &#123; placement &#125;.

Slots ​

NameDescription
(default)The popup content to be positioned.
anchorThe reference element the popup is positioned relative to.

CSS Parts ​

NameDescription
popupThe popup container element.
arrowThe arrow element (rendered when arrow is true).
hover-bridgeThe transparent hover bridge element.

CSS Custom Properties ​

PropertyDefault
--flint-popup-arrow-size8px
--flint-popup-arrow-colorinherit
--auto-size-available-width—
--auto-size-available-height—

Methods ​

MethodDescription
reposition(): voidForce a reposition of the popup.