Scroll areas

From dembrandt/dembrandt-skills · View interactive version

Scroll areas is an AI agent skill from the GitHub repository dembrandt/dembrandt-skills. Avoid inner scroll containers; when unavoidable, one axis at a time. Use when a layout, table or panel might scroll inside the page.

How to use this skill

Skill file

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:

When a Scroll Area Is Justified

Some layouts genuinely require inner scroll:

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.

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

Scroll must never happen automatically without user intent. Specifically:

Exception: chat and log panels may auto-scroll to the bottom on new content, but only if the user is already at the bottom. If the user has scrolled up to read, do not force them back down — show a "new messages" indicator instead.

Scroll Affordance

Users must be able to tell a region is scrollable before they attempt to scroll it.

Neither cue is reliable: overlay scrollbars (macOS, touch) appear only while scrolling, and a clipped item signals more only when the cut lands mid-item. Give every nested scroll region an edge cue: a shadow or fade shown only at an edge with hidden content. Gradients with background-attachment: local over shadows with scroll do this in pure CSS, but opaque row backgrounds cover them; there, fade the content with mask-image.

Review Checklist

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.