Positioning Utilities

Pillar provides utility-first positioning classes for building consistent, layout-aware components. These classes cover standard position values and common inset patterns like top-left or center-center—so you can skip writing custom styles.

Position

ClassCSS PropertyDescription
P-relativeposition: relative;Establishes a positioned ancestor (used with absolute children)
P-absoluteposition: absolute;Removes the element from the normal flow, positioned relative to nearest positioned ancestor
P-fixedposition: fixed;Positions the element relative to the viewport
P-stickyposition: sticky;Scrolls with the container until it reaches an offset

Predefined Inset Positions

These helper classes combine top, bottom, left, right, and transform properties to quickly anchor elements in common areas of the container.

ClassCSS PropertiesDescription
P-start-starttop: 0; left: 0;Pin to top-left
P-start-centertop: 0; left: 50%; transform: translateX(-50%);Top center (horizontal center)
P-start-endtop: 0; right: 0;Pin to top-right
P-center-starttop: 50%; left: 0; transform: translateY(-50%);Vertical center, aligned left
P-center-centertop: 50%; left: 50%; transform: translate(-50%, -50%);Full center (both axes)
P-center-endtop: 50%; right: 0; transform: translateY(-50%);Vertical center, aligned right
P-end-startbottom: 0; left: 0;Pin to bottom-left
P-end-centerbottom: 0; left: 50%; transform: translateX(-50%);Bottom center (horizontal center)
P-end-endbottom: 0; right: 0;Pin to bottom-right