TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/toolwind/anchors/llms.txt
Use this file to discover all available pages before exploring further.
{property}-anchor-{side} utilities let you position an anchored element by computing its top, right, bottom, left, or inset value from a specific edge of its anchor. Unlike position-area, which places an element in a grid-like region relative to the anchor, these utilities use the anchor() CSS function to pin one edge of the floating element to a precise edge of the anchor. Use them when you need sub-pixel control, offset spacing, or when the declarative region model of position-area is not expressive enough.
Directional properties
The utility prefix corresponds directly to the CSS property being set:| Prefix | CSS property |
|---|---|
top-anchor-{side} | top |
right-anchor-{side} | right |
bottom-anchor-{side} | bottom |
left-anchor-{side} | left |
inset-anchor-{side} | inset |
Anchor sides
The{side} segment maps to a named anchor side passed directly into the anchor() function:
| Utility suffix | anchor() side |
|---|---|
-top | top |
-right | right |
-bottom | bottom |
-left | left |
-start | start |
-end | end |
-self-start | self-start |
-self-end | self-end |
-center | center |
Basic usage
Usetop-anchor-bottom to align the top edge of the floating element with the bottom edge of its anchor:
Offsets using the Tailwind spacing scale
Append any Tailwind spacing value to add acalc() offset. For example, -4 corresponds to 1rem in the default spacing scale:
-:
Named anchor modifier
By default theanchor() function relies on the element’s implicit position-anchor. Add a /name modifier to target a specific named anchor instead.
Non-dashed ident — the plugin prefixes the name with --tw-anchor_:
Alignment utilities
In addition to the directional utilities above, the plugin providesanchor-center alignment helpers. These set the corresponding CSS alignment property to anchor-center, which centers the floating element over the anchor along that axis:
| Utility | CSS property | Value |
|---|---|---|
justify-self-anchor | justify-self | anchor-center |
self-anchor | align-self | anchor-center |
items-anchor | align-items | anchor-center |
justify-items-anchor | justify-items | anchor-center |
place-self-anchor | place-self | anchor-center |
place-items-anchor | place-items | anchor-center |
Related
anchored and position-area
The declarative region-based positioning model.
anchor-size() sizing
Size an element relative to its anchor’s dimensions.