content-auto
Maps to content-visibility: auto for sections that can be skipped offscreen.
01 · Why it exists
Browsers normally render every section, card, and image even when the user has not scrolled to that content yet. On documentation pages, directories, and article archives, that initial work can be wasted.
content-visibility: auto lets the browser skip off-screen rendering until it is
needed. This plugin makes that optimization available as Tailwind utilities.
Utilities
content-autoMaps to content-visibility: auto for sections that can be skipped offscreen.
content-hiddenMaps to content-visibility: hidden for content that should not render.
content-visibleRestores normal rendering with content-visibility: visible.
Adds contain-intrinsic-size helpers so skipped content reserves space.
02 · Setup
| Step | Detail |
|---|---|
| Install | npm install tailwindcss-visibility |
| Register | Add require('tailwindcss-visibility') to tailwind.config.js. |
| Use | Apply content-auto and a size hint to long sections or repeated cards. |
| Tailwind v4 | Use a CSS-first approach instead. This plugin targets the v3 JavaScript plugin model. |
03 · Best fit
The best candidates are long pages with repeated sections: docs, product grids, feeds, archives, and marketing pages with many cards below the fold.
Pair content-auto with a realistic intrinsic size hint. That prevents layout jumps
while still letting the browser defer rendering work.
Keep exploring