Anchor Positioning Utilities

Progressively tether positioned elements to named anchors and provide viewport-aware fallback positions.

Anchor utilities expose CSS Anchor Positioning directly. The relationship is progressive enhancement: keep source order useful and provide an ordinary positioning fallback for browsers without support.

Name and reference an anchor

Anchor names are .anchor-name-top, .anchor-name-bottom, .anchor-name-left, .anchor-name-right, and .anchor-name-center. The matching .position-anchor-* utility connects the positioned element.

Tether a panel below a control

The button owns a named anchor; the panel references it and chooses the bottom position area.

Choose a position area

Use .position-area-top, .position-area-bottom, .position-area-left, .position-area-right, the four corner variants, or .position-area-center. These rules are emitted only when position-area is supported.

Place contextual help beside its field

The same named relationship can choose a right-side area instead of encoding viewport coordinates.

Viewport fallback positions

.position-try-fallback applies the library’s --fallback-positions rule, which tries bottom, top, right, and left placements as available space changes.

<button class="anchor-name-center">Open help</button>
<aside class="pos-absolute position-anchor-center position-area-bottom position-try-fallback">
Help content
</aside>

The utility handles placement only. Use native Popover API or an appropriate component for dismissal, focus management, and interactive behavior.