# Excessive Whitespace

**SHOULD** · **ID:** `design-excessive-whitespace` · **Category:** design
**Source:** Custom
**Interactive version:** https://ui-guides-agent-rules.netlify.app/principles/design-excessive-whitespace

> SHOULD: Balance whitespace - excessive gaps break visual relationships and increase scrolling. Group related elements with proximity. Whitespace should be intentional.

Too much whitespace can fragment related content

This is our own rule, not an upstream citation — the Rams review has no bullet for it, and we previously mislabelled it as one. It is the mirror of design-crowded-elements, and the reason both exist is that whitespace is not a quantity to maximise, it is a signal. The Gestalt law of proximity says the eye groups what is near and separates what is far, so a generous gap dropped between a label and its input, or between a heading and the paragraph it introduces, actively tells the reader they are unrelated. Keep intra-group spacing smaller than inter-group spacing and the layout parses itself; invert that ratio and no amount of air will save it.

## Bad — do not do this

`design-excessive-whitespace-bad`

```tsx
export function ExcessiveWhitespaceBad() {
  return (
    <div className="w-full max-w-sm space-y-4">
      <div className="bg-card border border-border rounded-lg p-4">
        <h4 className="font-medium mb-3">Excessive Whitespace</h4>
        <form className="space-y-8 p-3 bg-muted rounded-lg" onSubmit={(e) => e.preventDefault()}>
          <div className="space-y-4">
            <label className="text-sm font-medium">Full Name</label>
            <input
              type="text"
              className="w-full px-3 py-2 border border-border rounded-md bg-background text-sm"
            />
          </div>
          <div className="space-y-4">
            <label className="text-sm font-medium">Email</label>
            <input
              type="email"
              className="w-full px-3 py-2 border border-border rounded-md bg-background text-sm"
            />
          </div>
        </form>
        <div className="mt-3 bg-muted rounded p-2 font-mono text-xs">
          <code className="text-error">space-y-8 between fields, space-y-4 for label/input</code>
        </div>
      </div>
      <p className="text-xs text-error">
        Labels feel disconnected from inputs - poor visual grouping
      </p>
    </div>
  );
}
```

## Good — do this

`design-excessive-whitespace-good`

```tsx
export function ExcessiveWhitespaceGood() {
  return (
    <div className="w-full max-w-sm space-y-4">
      <div className="bg-card border border-border rounded-lg p-4">
        <h4 className="font-medium mb-3">Balanced Spacing</h4>
        <form className="space-y-4 p-3 bg-muted rounded-lg" onSubmit={(e) => e.preventDefault()}>
          <div className="space-y-1.5">
            <label className="text-sm font-medium">Full Name</label>
            <input
              type="text"
              className="w-full px-3 py-2 border border-border rounded-md bg-background text-sm"
            />
          </div>
          <div className="space-y-1.5">
            <label className="text-sm font-medium">Email</label>
            <input
              type="email"
              className="w-full px-3 py-2 border border-border rounded-md bg-background text-sm"
            />
          </div>
          <button className="w-full px-4 py-2 bg-primary text-primary-foreground rounded-md text-sm">
            Submit
          </button>
        </form>
        <div className="mt-3 bg-muted rounded p-2 font-mono text-xs">
          <code>space-y-4 between fields, space-y-1.5 for label/input</code>
        </div>
      </div>
      <p className="text-xs text-success">
        Labels stay connected to inputs, fields properly separated
      </p>
    </div>
  );
}
```

## References

- [NN/g — The Principle of Proximity](https://www.nngroup.com/articles/gestalt-proximity/)
