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.
anchored utility family wires an element to a named anchor and controls where it appears relative to that anchor. It covers three distinct use cases: attaching an element to an anchor by name, setting a position area on its own, and doing both at once with a single shorthand class.
anchored/ — attach to an anchor
anchored/{name} sets position-anchor on the element, linking it to the anchor registered under that name. It also applies position: absolute and a view-transition-name at zero specificity so they are trivially overridable.
anchor/{name} apply here: a plain name like my-anchor is prefixed to --tw-anchor_my-anchor, while --my-anchor is used as-is, and variable shorthands produce var() references.
position: absolute and view-transition-name are set inside :where(&), which reduces their specificity to zero. This means any other positioning utility you add — fixed, relative, or an arbitrary [position:sticky] — will override them without needing !important. The position-anchor declaration itself is set at normal specificity.The
view-transition-name value is derived deterministically from the anchor name using a base-36 character encoding, so it is unique per name and will not collide with your own view-transition-name declarations. This makes every anchored element animatable via document.startViewTransition() with no extra configuration. See View Transitions for details.anchored- — set position area only
anchored-{position} sets position-area without touching position-anchor or position. Use this when you have already linked the element to an anchor via anchored/{name} (or by other means) and only want to control placement.
anchored-/ — shorthand
anchored-{position}/{name} combines position-anchor, position-area, position: absolute, and view-transition-name into a single class.
/{name} modifier follows the same naming conventions as anchor/{name} and anchored/{name}.
Overriding view-transition-name
If you need to opt out of the auto-generatedview-transition-name, add an arbitrary property class alongside your anchored class:
view-transition-name is set inside :where() at zero specificity, this single arbitrary class is enough to override it.
Full example
position-area values
Full list of every supported position area value and how it maps to CSS.
anchor/{name}
How to register an element as a named anchor.