ui-safe-area-scroll — Claude Code rule: what it does, how to install
ui-safe-area-scroll is a Claude Code rule that enforces native iOS safe area handling in React Native ScrollViews. It stops layout jumping during keyboard transitions.
AGPL-3.0 ★ 88 updated 2026-11-17
.claude/rules/ui-safe-area-scroll.mdWhat ui-safe-area-scroll does
The rule instructs agents to assign contentInsetAdjustmentBehavior="automatic" to the root ScrollView. It actively prevents enclosing scroll containers inside SafeAreaView components or computing top padding with safe area insets hooks.
Native iOS inset adjustments let lists flow behind the status bar. The layout adapts dynamically when on-screen toolbars or keyboards open, avoiding shifts in UI elements.
What it helps with
- stop wrapping React Native ScrollView elements in SafeAreaView
- eliminate manual top padding calculations via safe area hooks
- allow scrollable content to pass behind the iOS status bar
- prevent layout shifts when dynamic toolbars or keyboards appear
Example prompts for the agent
- Create a settings screen with a ScrollView that respects iOS safe areas
- Refactor this screen to remove SafeAreaView from around the scroll container
- Fix the list layout so it scrolls behind the status bar naturally
How to install ui-safe-area-scroll
Manually: put the files in place
.claude/rules/ui-safe-area-scroll.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-safe-area-scroll.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/ui-safe-area-scroll.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/ui-safe-area-scroll.mdManually: put the files in place
.clinerules/ui-safe-area-scroll.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about ui-safe-area-scroll
How to install ui-safe-area-scroll in Claude Code?
Place the rule file at .claude/rules/ui-safe-area-scroll.md in your project root directory.
What does ui-safe-area-scroll do?
It directs coding assistants to rely on contentInsetAdjustmentBehavior="automatic" rather than adding manual paddings or SafeAreaView wrappers.
Why avoid manual padding on React Native scroll containers?
Manual padding prevents content from scrolling under the status bar and causes layout shifts when system bars change size.