Skip to main content

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.

This page walks you through installing @toolwind/anchors and registering it with your Tailwind CSS setup. The package supports both the CSS-first config introduced in Tailwind v4 and the JS config used in Tailwind v3.
1

Install the package

Install @toolwind/anchors as a dev dependency using your preferred package manager.
npm install -D @toolwind/anchors
The package runs a postinstall script that applies a patch via patch-package. This only runs when your project is inside a git repository. Outside of a git repo (for example, in a CI environment with no .git directory) the step is skipped automatically and a message is logged instead.
2

Register the plugin with Tailwind

How you register the plugin depends on which version of Tailwind CSS you are using.
In Tailwind v4, plugins are imported directly in your CSS file using @import. Add the following line to your main stylesheet:
style.css
@import "@toolwind/anchors";
This is typically your entry CSS file — the same file where you import tailwindcss itself.
3

Verify the setup

Add a quick smoke test to confirm the plugin is generating classes. Add these classes to any element in your markup:
<div class="anchor/my-btn">Button</div>
<div class="anchored-bottom-center/my-btn">Tooltip</div>
Inspect the element in your browser’s DevTools. You should see anchor-name set on the first element and position-anchor plus position-area set on the second.

Peer dependencies

@toolwind/anchors requires Tailwind CSS as a peer dependency:
tailwindcss >= 3.0.0 || >= 4.0.0
No other runtime dependencies are required.

Next steps

Quickstart

Build a tooltip using anchor and anchored utilities.

Utility index

See every utility class the plugin provides.

Build docs developers (and LLMs) love