Skip to main content
skill CX Codex

law-of-figure-ground — Claude Code skill for UI layers

A skill that sorts out which layer of an interface reads as foreground and which as background, and helps you set that relationship on purpose.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add Owl-Listener/designer-skills --skill law-of-figure-ground -a claude-code
Open on GitHub

What law-of-figure-ground does

The skill builds on the law of figure-ground: the mind splits a visual field into a subject and a context on its own. The figure looks closer, has edges, and holds attention. The ground sits behind and has no boundary. That split is a reflex, not a decision, so every surface in your UI triggers it — the only question is whether you designed the split or left it to chance.

It walks through the tools that control the relationship: elevation and shadow, a scrim under a modal, text contrast against its surface, and selected versus unselected states in navigation. Dark mode gets its own section. Light and dark themes invert the usual luminance order, and a shadow that read as elevation in light mode can vanish entirely in dark mode. The skill suggests a subtle light border or a fill at a different luminance instead.

There is a list of common failures: a modal on a white page with no scrim, cards nested inside cards with no luminance difference, text laid straight over photography, flat design with no depth signal at all. The test is simple — strip the colour and see whether foreground and background still separate by shape and contrast. If they do not, the hierarchy rests on hue alone, and that is worth fixing.

What it helps with

  • separate foreground from background in a modal
  • pick a scrim that makes the page recede
  • make the active nav item clearly selected
  • keep depth readable in dark mode
  • check surface hierarchy without relying on colour

Example prompts for the agent

  • Check this modal against law-of-figure-ground — the page behind it does not recede
  • Walk through the selected state in the sidebar with law-of-figure-ground
  • Shadows disappear in dark mode; what does law-of-figure-ground suggest

How to install law-of-figure-ground

1Skills CLI (Vercel)

npx skills add Owl-Listener/designer-skills --skill law-of-figure-ground -a claude-code

2Manually: put the files in place

~/.claude/skills/law-of-figure-ground/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/law-of-figure-ground/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about law-of-figure-ground

How do I install law-of-figure-ground in Claude?

Run npx skills add Owl-Listener/designer-skills --skill law-of-figure-ground -a claude-code. The skill file lands at ~/.claude/skills/law-of-figure-ground/SKILL.md.

What does law-of-figure-ground do?

It helps the agent read UI layers as figure or ground and control that relationship through elevation, scrims and contrast.

How is law-of-figure-ground different from von-restorff-effect?

This one covers layers and depth — modals, overlays, scrims. For pulling one element out of a group of peers, the same collection has von-restorff-effect.

Source text

SKILL.md · MIT
---
name: law-of-figure-ground
description: Apply the Law of Figure-Ground — establish which layer is foreground and actionable versus background. Use when designing modals, overlays, and depth. For emphasising one element among peers, use `von-restorff-effect`.
---
# Law of Figure-Ground

You are an expert in visual attention and the perceptual hierarchy of UI surfaces.

## What You Do

You apply the Law of Figure-Ground to ensure users can instantly identify what is foreground (the content or action) and what is background (the context or surface), and to control this relationship deliberately at every layer of the interface.

## The Principle

The mind automatically separates visual fields into a subject (the figure) and a context (the ground). Figure is perceived as being in front, bounded, and the focus of attention. Ground is perceived as behind, unbounded, and receding.

This parsing is not a choice — it is a perceptual reflex. Every UI surface triggers figure-ground separation. The question is whether you designed it deliberately or left it to chance.

## Characteristics of Figure vs. Ground

| Figure (foreground) | Ground (background) |
|---|---|
| Appears in front | Appears behind |
| Bounded — perceived as having edges | Unbounded — perceived as extending beyond the figure |
| Focus of attention | Context for attention |
| Higher contrast, richer texture or detail | Lower contrast, flatter, more uniform |
| Typically smaller area | Typically larger area |

## Establishing Clear Figure-Ground in UI

### Elevation and shadow

Elevation is the primary tool for figure-ground in layered design systems. A card elevated above a page surface is figure; the page is ground. The shadow signals depth, and depth signals foreground. Dropdowns, sheets, modals, and tooltips must appear above the surface they are called from — depth signals primacy.

### Overlays and scrims

A modal requires the background to recede. A scrim — a semi-transparent dark overlay — reduces the ground's visual presence so the modal can be unambiguous figure. Without a scrim, figure-ground is unclear and attention is split between the modal and the page beneath it.

### Contrast

High-contrast elements are perceived as figure; low-contrast elements as ground. Text on a surface works through figure-ground: the text is figure (high contrast, bounded by its line), the surface is ground (lower contrast, unbounded). When text and background share too similar a luminance value, figure-ground collapses and the text is no longer legible.

### Active and selected states

In navigation or lists, the selected item becomes figure; unselected items become ground. The selected state — a background fill, a bold type treatment, a color change — must make the figure-ground shift unambiguous. If the selected and unselected states are too similar, users cannot tell which item is active.

## Ambiguous Figure-Ground

Ambiguous figure-ground occurs when the same element can be read as either figure or ground — the visual equivalent of the Rubin vase. In fine art and illustration this is sometimes intentional. In UI, it is almost always a failure.

If users cannot immediately parse what is content and what is surface, they cannot act with confidence.

## Common Figure-Ground Failures

- **Insufficient scrim**: a modal on a white page without a scrim requires users to parse figure-ground from edges alone — always provide a background-dimming layer
- **Nested elevation without contrast**: cards inside cards without clear luminance difference between levels produce ambiguous depth
- **Text on photography**: the image competes as figure; separate text from images with a color overlay, blur, or gradient layer
- **Flat design without surface differentiation**: removing elevation signals entirely makes foreground/background relationships invisible — some depth signal is necessary

## Dark Mode Considerations

Light and dark modes invert the typical luminance relationship between figure and ground. What was dark figure on a light ground becomes light figure on a dark ground. Shadows that read as elevation in light mode may become invisible in dark mode — use subtle light-colored borders or reduced-luminance fills to maintain figure-ground clarity when shadows disappear.

## Best Practices

- Define your surface stack in design tokens: base, raised, overlay, modal — each level should have a clear and consistent contrast relationship to the layers below it
- Never place text directly on photography or complex imagery without a separation layer
- Test figure-ground by removing color: can you still identify foreground from background using only shape and contrast?
- Use elevation sparingly — the more surface layers you stack, the harder it becomes to maintain an unambiguous hierarchy
- Validate scrims in both themes: a scrim that works in light mode may need adjusting in dark mode where the base surface is already dark

© Owl-Listener · MIT · Owl-Listener/designer-skills

Similar skills

Everything for Design →

From the same set109

platform-conventions The skill maps what iOS and Android each mandate in their interfaces, where the two diverge, and when a single cross-platform design makes sense. CX Codex +1 1,100installs law-of-continuity A skill about the Law of Continuity: alignment, arrows and lines set the path the eye follows across an interface. Useful for forms, carousels and timelines. CX Codex +1 1,100installs conversational-ux Designs voice interfaces and chat dialogs: prompt structure and error reprompt ladders. Ideal when speech or chat replaces screens. CX Codex +1 1,100installs law-of-closure Teaches the agent to build UI on implied boundaries: drop redundant borders, draw icons from minimal cues, and let negative space carry the structure. CX Codex +1 1,100installs law-of-similarity Applies the Gestalt Law of Similarity to group UI elements across distance using shared color, shape, and size. Useful for unifying components without altering layout. CX Codex +1 1,100installs serial-position-effect A skill that applies the serial position effect: it tells the agent which items belong first and last, and what lands in the memory valley. CX Codex +1 1,000installs teslers-law Applies Tesler's Law to help you balance complexity between the interface and the user. Useful when designing forms, multi-step flows, and settings. CX Codex +1 1,000installs zeigarnik-effect A skill for designing progress bars, saved drafts and reminders about unfinished steps. It gives the agent a framework for using incompleteness as a motivational signal. CX Codex +1 1,000installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor