Anchors for Tailwind CSS is a plugin that adds full support for the CSS Anchor Positioning API to your Tailwind workflow. Rather than writing raw CSS, you can define anchors and position elements relative to them entirely through utility classes — with support for Tailwind v3 and v4.Documentation 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.
Installation
Install the plugin and configure it for Tailwind v3 or v4 in minutes.
Quickstart
Build your first anchored UI element with a working code example.
Core Utilities
Learn the
anchor, anchored, and position-area utility families.Utility Index
Browse every utility class provided by this plugin at a glance.
What is CSS Anchor Positioning?
CSS Anchor Positioning is a native browser API that lets you position elements relative to other elements — called anchors — without JavaScript. It replaces complex positioning hacks with a clean, declarative model. This plugin exposes the full API as Tailwind utilities:anchor/{name}— mark an element as a named anchoranchored/{name}— attach a floating element to an anchoranchored-{position}— set the position area relative to the anchortop-anchor-bottom,w-anchor— useanchor()andanchor-size()functionstry-flip-all,anchored-visible-anchor— fallback and visibility control
anchor() Functions
Explicit directional positioning using the
anchor() CSS function.anchor-size() Sizing
Size elements relative to their anchors with
anchor-size().Position Visibility
Control when anchored elements are shown with
position-visibility.View Transitions
Animate position changes with the built-in View Transitions integration.
Get started
Register the plugin
Import the plugin in your Tailwind CSS config (v4) or
tailwind.config.js (v3).Tailwind v4