Skip to main content
rule CX Codex

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

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/rules/ui-safe-area-scroll.md
Open on GitHub

What 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.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 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.

Similar IDE rules

All IDE rules for Mobile →

From the same set47

The whole set →
fonts-config-plugin fonts-config-plugin is a Claude Code rule that embeds Expo fonts at build time. It directs the assistant to configure the expo-font plugin instead of runtime loaders. CX Codex +1 ★ 88repo stars list-performance-images list-performance-images is a Claude Code rule for loading appropriately sized images in lists. It applies when editing interfaces that display image thumbnails. CX Codex +1 ★ 88repo stars imports-design-system-folder imports-design-system-folder is a Claude Code rule that forbids importing UI packages directly into application code. All components must pass through a local design system directory. CX Codex +1 ★ 88repo stars ui-pressable ui-pressable is a Claude Code rule for choosing touch components in React Native. It applies when an agent adds or edits buttons and list items. CX Codex +1 ★ 88repo stars design-system-compound-components design-system-compound-components is a Claude Code rule that forbids raw string children in non-text components. It enforces compound structures like ButtonText and ButtonIcon across the design system. CX Codex +1 ★ 88repo stars ui-expo-image ui-expo-image is a Claude Code rule that swaps React Native's default Image for expo-image. It guides code generation toward blurhash placeholders, disk caching, and list recycling. CX Codex +1 ★ 88repo stars js-hoist-intl js-hoist-intl is a Claude Code rule that moves Intl formatter creation out of renders and loops. It applies to JavaScript code that formats dates, numbers, or relative time. CX Codex +1 ★ 88repo stars react-state-fallback react-state-fallback is a Claude Code rule that enforces reactive fallbacks instead of copying props into component state. It prevents stale UI bugs during parent updates. CX Codex +1 ★ 88repo stars

Project sponsors

Companies that keep this analytics open