Skip to main content
rule CX Codex

rendering-content-visibility — Claude Code rule for deferred rendering

The rendering-content-visibility rule applies content-visibility: auto to long lists so off-screen items can wait before rendering. It fits message feeds and other scrollable collections.

no license ★ 1,064 updated 2026-01-21

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/rules/rendering-content-visibility.md
Open on GitHub

What rendering-content-visibility does

The rule describes a CSS technique for long lists: set content-visibility: auto on list items and provide a placeholder size with contain-intrinsic-size. The browser can defer layout and painting for items outside the visible area.

Its example uses messages inside a scrollable container. Each item gets an estimated height of 80px; if actual items differ substantially, that placeholder may need adjustment to match the list’s layout. For Claude Code, place the rule file at .claude/rules/rendering-content-visibility.md.

What it helps with

  • defer rendering for items outside a long list’s viewport
  • apply content-visibility: auto to messages in a scrollable feed
  • set a placeholder size for items that have not been rendered

Example prompts for the agent

  • Apply the rule to this long message feed and show the CSS changes.
  • Update the scrollable list so off-screen items can be rendered later.
  • Check how to size placeholders for list items using content-visibility: auto.

How to install rendering-content-visibility

Manually: put the files in place

.claude/rules/rendering-content-visibility.md

The paths frontmatter field limits the files

Step by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use

Questions about rendering-content-visibility

How do I install rendering-content-visibility in Claude Code?

Add the rule file at .claude/rules/rendering-content-visibility.md.

What does rendering-content-visibility do?

It describes using content-visibility: auto to defer rendering list items that are outside the viewport.

Why does the rule use contain-intrinsic-size?

It provides a placeholder size for items that have not been rendered yet. The example sets it to 0 80px for messages.

Similar IDE rules

All IDE rules for Frontend and UI →

From the same set20

The whole set →
async-parallel async-parallel — a Claude rule that sends independent async calls through Promise.all() instead of awaiting them one by one. Useful when a handler piles up sequential awaits. CX Codex +1 ★ 1,064repo stars rerender-derived-state The rerender-derived-state rule favors derived boolean state over continuously changing values, reducing React re-renders. It fits responsive UI logic. CX Codex +1 ★ 1,064repo stars js-combine-iterations js-combine-iterations tells the Claude agent to replace several filter or map passes over the same array with one loop that fills the results as it goes. CX Codex +1 ★ 1,064repo stars bundle-dynamic-imports bundle-dynamic-imports guides Claude Code to lazy-load heavy components using next/dynamic with SSR disabled. Keeps your initial client bundle lean to protect TTI and LCP metrics. CX Codex +1 ★ 1,064repo stars rerender-dependencies rerender-dependencies — a Claude rule that keeps useEffect dependency arrays on primitives like user.id rather than whole objects, so an effect stops firing on every field change. CX Codex +1 ★ 1,064repo stars testing The testing rule sets conventions for TypeScript test files and the __tests__ directory. Use it to guide checks for success cases, failures, and edge conditions. CX Codex +1 ★ 1,064repo stars forge The forge rule configures Foundry workflows for Abstract and tells Claude Code to use the ZKsync mode for Solidity projects. CX Codex +1 ★ 1,064repo stars js-batch-dom-css js-batch-dom-css — a Claude rule that keeps the agent from writing styles one property at a time and pushes it toward a class or a single cssText string. CX Codex +1 ★ 1,064repo stars

Project sponsors

Companies that keep this analytics open