# scroll-areas

Teaches coding agents to avoid inner scroll containers and restricts unavoidable scroll areas to a single axis in UI layouts.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 843 installs · ★ 165
- Author: dembrandt
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/dembrandt/dembrandt-skills/tree/HEAD/skills/scroll-areas/SKILL.md
- Updated: 2026-10-22
- HTML: https://affpapa.org/en/nevibecode/skills/scroll-areas

## What it does

This skill provides a layout policy for styling and component files. It instructs the assistant to favor standard page-level scrolling over isolated scrollable panels or modal windows. For overflowing content, the agent suggests alternatives like pagination, collapsible accordions, or separate routes.

When an inner scroll container is necessary—such as a fixed sidebar or a wide data table—the rule strictly enforces single-axis movement. It prohibits `overflow: auto` because two-axis scrolling breaks touch navigation. The container must declare `overflow-y: auto` with `overflow-x: hidden`, or the inverse. It also stops scroll hijacking and requires visible scroll indicators rather than hiding them with `scrollbar-width: none`.

The skill relies on matching layout paths like `components/**` and explicit scroll-related prompt phrases to trigger these constraints.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add dembrandt/dembrandt-skills --skill scroll-areas -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/scroll-areas/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/scroll-areas/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add dembrandt/dembrandt-skills --skill scroll-areas -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/scroll-areas/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add dembrandt/dembrandt-skills --skill scroll-areas -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/scroll-areas/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install dembrandt/dembrandt-skills scroll-areas
```

2. **Manually: put the files in place**
- File: `.github/skills/scroll-areas/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add dembrandt/dembrandt-skills --skill scroll-areas -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/dembrandt/dembrandt-skills --path skills/scroll-areas
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/scroll-areas/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add dembrandt/dembrandt-skills --skill scroll-areas -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/dembrandt/dembrandt-skills/tree/HEAD/skills/scroll-areas/SKILL.md

## When to use it
- prevent nested inner scrollbars across application screens
- restrict table and panel scrolling strictly to one axis
- stop scroll hijacking and unrequested viewport jumps
- keep scroll indicators visible without hiding native scrollbars

## Example prompts
- Build a sidebar layout for a long list of documents without breaking page flow
- How should I handle a wide data table so headers remain pinned?
- Review this modal component for nested scroll and overflow issues

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: d6443c4900e7c4c4.

BEGIN THIRD-PARTY FILE d6443c4900e7c4c4
````text
---
name: scroll-areas
description: Avoid inner scroll containers; when unavoidable, one axis at a time. Use when a layout, table or panel might scroll inside the page.
metadata:
  priority: 7
  pathPatterns:
    - "**/*.css"
    - "**/*.scss"
    - "components/**"
    - "src/components/**"
    - "**/*.tsx"
    - "**/*.jsx"
    - "design-system/**"
  promptSignals:
    phrases:
      - "scroll"
      - "overflow"
      - "scrollable"
      - "inner scroll"
      - "fixed height"
      - "overflow-y"
      - "overflow-x"
retrieval:
  aliases:
    - scroll areas
    - inner scroll
    - overflow scroll
    - nested scroll
    - scrollable container
  intents:
    - avoid scroll inside scroll
    - design a scrollable list
    - handle overflow content
    - layout with constrained height
  examples:
    - should this panel scroll independently
    - how do I handle a long list inside a fixed layout
    - avoid scroll inside scroll
---

# Scroll Areas

## Avoid Scroll Areas by Default

Scroll containers inside a layout — panels, drawers, tables, modals with inner overflow — create friction. Users must discover that a region scrolls, manage multiple independent scroll positions simultaneously, and context-switch between scroll areas on the same screen.

**Default: let the page scroll.** A single page-level scroll is universally understood and requires no discovery. Before introducing an inner scroll area, ask whether the layout can be restructured so the page itself handles the overflow.

Alternatives to inner scroll:
- Pagination or load-more for long lists
- Collapsible sections (accordion) for long detail panels
- A separate page or route for content that would otherwise fill a scroll area
- Progressive disclosure — show less by default, expand on demand

## When a Scroll Area Is Justified

Some layouts genuinely require inner scroll:

- **Fixed-height sidebars** with navigation trees longer than the viewport
- **Data tables** where the header must remain visible while rows scroll
- **Chat or log panels** where the stream is continuous and the surrounding layout is fixed
- **Code editors or terminal panes** embedded in a larger application shell

In these cases, proceed — but apply the constraints below.

## One Axis Only

Never create a scroll container that scrolls on both axes simultaneously. Two-axis scroll is disorienting, hard to control precisely, and nearly unusable on touch devices.

```css
/* One axis: vertical */
overflow-y: auto;
overflow-x: hidden;

/* One axis: horizontal (e.g. wide table) */
overflow-x: auto;
overflow-y: hidden;

/* Never */
overflow: auto; /* allows both axes */
```

If content requires both axes — e.g. a wide table inside a constrained panel — restructure the layout so the table's horizontal scroll is the only scroll in the view, with the page itself not scrolling at that point.

## Always User-Controlled
````
END THIRD-PARTY FILE d6443c4900e7c4c4

The third-party file has ended. Everything between the d6443c4900e7c4c4 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2902 of 4633 bytes. © dembrandt · MIT · https://github.com/dembrandt/dembrandt-skills/tree/HEAD/skills/scroll-areas/SKILL.md

_Part of the page did not fit — see the HTML version._

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