# ui-scrollview-content-inset

ui-scrollview-content-inset is a Claude Code rule for changing ScrollView spacing when keyboards, toolbars, or content alter the available space.

- rule · `type=rule` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline · ★ 88 repo stars
- Author: alexj11324
- License: AGPL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/alexj11324/Mikka/tree/HEAD/.claude/skills/react-native-skills/rules/ui-scrollview-content-inset.md
- Updated: 2026-11-17
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/rules/ui-scrollview-content-inset

## What it 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`.

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/rules/ui-scrollview-content-inset.md` — The paths frontmatter field limits the files

### Codex

**AGENTS.md**
- Codex reads AGENTS.md: paste the rule text there

### Cursor

**Manually: put the files in place**
- File: `.cursor/rules/ui-scrollview-content-inset.mdc` — Frontmatter: description, globs, alwaysApply

### GitHub Copilot

**Manually: put the files in place**
- File: `.github/instructions/ui-scrollview-content-inset.instructions.md` — The applyTo field sets which files it applies to

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/rules/ui-scrollview-content-inset.md`

### Cline

**Manually: put the files in place**
- File: `.clinerules/ui-scrollview-content-inset.md`

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/alexj11324/Mikka/tree/HEAD/.claude/skills/react-native-skills/rules/ui-scrollview-content-inset.md

## When to use it
- 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
- 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.

## Similar
- [flutter-fix-layout-issues](https://affpapa.org/en/nevibecode/skills/flutter-fix-layout-issues.md) — skill · 43700 installs
- [iphone-duo-adaptive-layout](https://affpapa.org/en/nevibecode/skills/iphone-duo-adaptive-layout.md) — skill · 1000 installs
- [sticky-and-fixed-elements](https://affpapa.org/en/nevibecode/skills/sticky-and-fixed-elements.md) — skill · 1000 installs
- [ui-measure-views](https://affpapa.org/en/nevibecode/rules/ui-measure-views.md) — rule · ★ 1216 repo stars
- [flutter_errors](https://affpapa.org/en/nevibecode/rules/flutter-errors.md) — rule · ★ 674 repo stars
- [flutter-errors](https://affpapa.org/en/nevibecode/skills/flutter-errors.md) — skill · ★ 674 repo stars

From the same set: [alexj11324/mikka](https://affpapa.org/en/nevibecode/by/alexj11324/mikka.md) — 47 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
