Gestalt ui organisation

From dembrandt/dembrandt-skills · View interactive version

Gestalt ui organisation is an AI agent skill from the GitHub repository dembrandt/dembrandt-skills. Group controls with Gestalt principles so users see what belongs together. Use when laying out components, navigation, toolbars, forms or dashboards.

How to use this skill

Skill file

Gestalt UI Organisation

UI should be organised so that the visual structure communicates relationships — which commands, controls, and elements belong together — without requiring users to read labels or documentation.

Core Gestalt Principles for UI Layout

1. Proximity

Elements that are close together are perceived as a group.

Example: A toolbar with [Cut] [Copy] [Paste] grouped tightly, then a wider gap before [Undo] [Redo], communicates two distinct command groups without any visual divider.

Prefer whitespace over separator lines

Default to whitespace, not divider lines, for grouping. Most separators do work that spacing does better — they add noise and a "boxed-in" feel without adding information. Remove the majority and let proximity carry the grouping.

Caveat: a line takes almost no space, so removing it leaves groups too close. Removing separators usually means adding spacing — budget the whitespace (occasionally a subtle background or heading) rather than just deleting the line and leaving the layout cramped.

The need for a separator grows with distance

Elements packed tightly separate themselves; elements far apart need help. A compact table with short rows reads without any lines, because each row is already next to the one it belongs with. The same table at full width, or with tall rows, needs row lines or zebra striping, or the eye loses its place crossing the row.

So the question is not "lines or no lines" but how far the elements sit from each other. Pick the lightest device that bridges the gap, in this order: spacing, a subtle fill or stripe, a hairline, a boxed region. Set it per size: a wide table may carry row lines while its compact variant in a sidebar drops them.

Cause and effect stay close

Proximity also governs time: what a click produces should appear next to the click. When a left-hand menu opens content that starts at the far right, the eye crosses the whole screen for every selection, and the user re-orients each time.

2. Similarity

Elements that look alike are perceived as related.

Example: Destructive actions (Delete, Remove) use a different colour than constructive actions (Save, Add), signalling different intent groups.

3. Common Region

Elements enclosed in a shared region are perceived as a group.

A region needs no border — but a borderless one needs air. Enclosure can come from a border/fill or from whitespace alone. When a card has no border or background, generous internal padding and a clear gap to its neighbours are what make it read as one region; without a border doing that job, cut the air and separate cards collapse into one blur. Borderless is fine — cramped-and-borderless is not.

One card, one subject. When adjacent cards describe the same thing, merge them under one heading and separate the parts with spacing before reaching for a divider. Then check the grid for orphan cells: a third child in a two-column grid leaves a hole that looks like something failed to load, unless one child spans the rows.

Example: Form sections grouped in bordered cards signal that fields inside each card form a logical unit.

4. Connectedness

Elements connected by lines or visual links are perceived as related.

5. Figure / Ground

Users distinguish foreground interactive elements from background context.

6. Continuity

The eye follows smooth paths and lines.

Review Checklist

When reviewing a UI layout for Gestalt compliance:

Common Anti-Patterns

| Anti-pattern | Problem | Fix |

|---|---|---|

| All buttons same size and colour regardless of function | Similarity principle violated — implies all actions are equivalent | Differentiate primary, secondary, destructive visually |

| Related controls spread across distant areas of the screen | Proximity violated — user cannot perceive the relationship | Co-locate related controls |

| Menu on the left, content starting far right | The eye crosses the screen on every selection | Anchor content left, title level with the selected row; add a middle column on wide screens |

| Overuse of divider lines to group elements | Relies on decoration rather than spatial logic | Use whitespace and proximity instead |

| Identical whitespace between all elements | No grouping signal — everything reads as a flat list | Apply 8pt/4pt spacing scale: tight within group, loose between groups |

| Mixed icon styles within one toolbar | Similarity broken — implies different functional families | Use a single consistent icon set and weight per toolbar |

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.