ui-scrollview-content-inset — Claude Code rule
ui-scrollview-content-inset is a Claude Code rule for changing ScrollView spacing when keyboards, toolbars, or content alter the available space.
AGPL-3.0 ★ 88 updated 2026-11-17
.claude/rules/ui-scrollview-content-inset.mdWhat ui-scrollview-content-inset does
The rule says to use contentInset for top or bottom spacing that changes over time, rather than padding. Updating the inset adjusts the scrollable area without recalculating the content layout. Pair it with scrollIndicatorInsets to align the scroll indicator.
This guidance concerns dynamic spacing, such as a bottom offset that changes with the content. Padding is fine for spacing that stays fixed. For Claude Code, install the rule at .claude/rules/ui-scrollview-content-inset.md.
What it helps with
- change the scroll area without recalculating content layout
- align the scroll indicator with a changing inset
- choose a spacing method for a fixed ScrollView gap
Example prompts for the agent
- Make the
ScrollViewbottom offset respond to the keyboard. - Add top spacing to a
ScrollViewthat changes with the toolbar. - Align the scroll indicator with the content's bottom inset.
How to install ui-scrollview-content-inset
Manually: put the files in place
.claude/rules/ui-scrollview-content-inset.mdThe paths frontmatter field limits the files
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/ui-scrollview-content-inset.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/ui-scrollview-content-inset.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/ui-scrollview-content-inset.mdManually: put the files in place
.clinerules/ui-scrollview-content-inset.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about ui-scrollview-content-inset
How do I install ui-scrollview-content-inset in Claude Code?
Add the rule at .claude/rules/ui-scrollview-content-inset.md.
What does ui-scrollview-content-inset do?
It recommends contentInset for changing ScrollView spacing so updates adjust the scrollable area without recalculating the content layout.
Should I use padding or contentInset for ScrollView spacing?
Use contentInset for spacing that changes and padding for fixed spacing. scrollIndicatorInsets keeps the indicator aligned with the inset.