◇
Popper
4 partsAnatomy
Import the parts and compose them. Each part forwards attributes to its underlying element.
vue
import {
PopperRoot,
PopperAnchor,
PopperContent,
PopperArrow,
} from '@robonen/primitives/popper';
<PopperRoot>
<PopperAnchor />
<PopperContent />
<PopperArrow />
</PopperRoot>API Reference
PopperRoot
RootNo props or events — renders its element and forwards attributes.
PopperAnchor
Anchor| Prop | Type | Description |
|---|---|---|
reference? | ReferenceElement | Custom reference element for positioning. If not provided, uses the rendered element. |
PopperContent
Content| Prop | Type | Description |
|---|---|---|
side? | Side | Preferred side of the anchor. |
sideOffset? | number | Distance in pixels from the anchor. |
sideFlip? | boolean | Flip to the opposite side on collision. |
align? | Align | Preferred alignment against the anchor. |
alignOffset? | number | Offset in pixels from the alignment edge. |
alignFlip? | boolean | Flip alignment on collision. |
avoidCollisions? | boolean | Reposition to prevent boundary overflow. |
collisionBoundary? | Array<Element | null> | Element | null | Collision boundary element(s). |
collisionPadding? | number | Partial<Record<Side, number>> | Distance from boundary for collision detection. |
arrowPadding? | number | Padding between arrow and content edges. |
hideShiftedArrow? | boolean | Hide arrow when it can't be centered. |
sticky? | 'always' | 'partial' | Sticky behavior on the align axis. |
hideWhenDetached? | boolean | Hide when anchor is fully occluded. |
positionStrategy? | 'absolute' | 'fixed' | CSS position strategy. |
updatePositionStrategy? | 'always' | 'optimized' | Position update strategy. |
disableUpdateOnLayoutShift? | boolean | Disable layout-shift-based position update. |
prioritizePosition? | boolean | Force content to stay within the viewport. |
reference? | ReferenceElement | Custom reference element, overrides the anchor. |
PopperArrow
Arrow| Prop | Type | Description |
|---|---|---|
width? | number | Arrow width in pixels. |
height? | number | Arrow height in pixels. |