Skip to main content
rule CX Codex

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

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

What 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 ScrollView bottom offset respond to the keyboard.
  • Add top spacing to a ScrollView that 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.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-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.

Similar IDE rules

All IDE rules for Frontend and UI →

From the same set47

The whole set →
list-performance-callbacks list-performance-callbacks is a Claude Code rule for passing event handlers to list items. It applies when callbacks are used inside a list. CX Codex +1 ★ 88repo stars monorepo-native-deps-in-app monorepo-native-deps-in-app is a Claude Code rule that enforces adding native packages directly to the mobile app manifest. It prevents build failures caused by missed autolinking in monorepos. CX Codex +1 ★ 88repo stars react-compiler-reanimated-shared-values react-compiler-reanimated-shared-values is a Claude Code rule for handling Reanimated shared values with React Compiler enabled. It directs code to use .get() and .set() rather than .value. CX Codex +1 ★ 88repo stars react-compiler-destructure-functions react-compiler-destructure-functions is a Claude Code rule that enforces extracting hook functions early in render scope. It targets projects running the React Compiler. CX Codex +1 ★ 88repo stars monorepo-single-dependency-versions monorepo-single-dependency-versions is a Claude Code rule that pins identical dependency versions across monorepo packages. It stops bundle bloat and runtime version clashes. CX Codex +1 ★ 88repo stars animation-derived-value animation-derived-value is a Claude Code rule for computing one animated shared value from another. It applies to React Native Reanimated code that derives values. CX Codex +1 ★ 88repo stars 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

Project sponsors

Companies that keep this analytics open