Vanilla Breeze

layout-imposter

A positioning helper for overlays, modals, and fixed UI elements. Uses CSS transforms for centering without requiring JavaScript calculations.

Attributes

Attribute Values Default Description
data-layout-fixed (boolean) Position relative to the viewport instead of the containing block.
data-layout-margin s, m, l, xl Inset from the edges when pinned to one.
data-layout-position center, top, bottom, start, end, top-start, top-end, bottom-start, bottom-end center Where to place the overlay.
data-layout-contain (boolean) Keep the overlay within the viewport, minus the margin, when fixed.

Basic Usage

The imposter positions itself within a positioned ancestor (or viewport when fixed).

Position Variants

The data-layout-position attribute controls placement within the container.

Edge Positions

Corner Positions

Usage Examples

Notification Badge

Image Overlay

Card with Status Badge

Loading Overlay

Related