From perception-and-hierarchy-principles
Use this skill whenever the design has more than one element on the page — every layout, every form, every table, every page header, every card. Trigger when designing a layout, picking a grid, fixing a UI that "looks off," debating left vs. center alignment for body text, or auditing why a design feels disorderly. Alignment is one of the most foundational principles in 'Universal Principles of Design' (Lidwell, Holden, Butler 2003) — every visible element's edge or center should fall on a shared axis with at least one other element. Misalignment by even a few pixels reads as disorder.
How this skill is triggered — by the user, by Claude, or both
Slash command
/perception-and-hierarchy-principles:alignmentThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Alignment is the placement of elements so that their edges or centers fall on shared axes — invisible vertical or horizontal lines that thread through the composition. Aligned elements feel ordered, professional, and easy to scan. Misaligned elements — even when the misalignment is small — read as accidental, sloppy, or unfinished. Of all the visual variables a designer manages, alignment is th...
Alignment is the placement of elements so that their edges or centers fall on shared axes — invisible vertical or horizontal lines that thread through the composition. Aligned elements feel ordered, professional, and easy to scan. Misaligned elements — even when the misalignment is small — read as accidental, sloppy, or unfinished. Of all the visual variables a designer manages, alignment is the cheapest to get right and the most expensive to get wrong.
When elements share an alignment axis, the eye can connect them as part of a system. A row of fields all sharing a left edge reads as a coherent column. A set of buttons all sharing a baseline reads as a related group. A hero headline sharing the page's center axis reads as a deliberate focal moment. When this discipline lapses — when a button is 4px off from its neighbors, when a label hangs out from the rest of the form — the eye registers the discrepancy preattentively. The user may not articulate it, but they sense the design is "off."
Alignment carries no information by itself — it doesn't tell the user what anything is. What it does is signal that the design was deliberate. A well-aligned composition reads as competent and trustworthy at a perceptual level the user doesn't consciously evaluate. Conversely, misalignment makes everything else feel suspect; if the designer couldn't get the column edges to line up, what else did they miss?
The cost of misalignment compounds:
A small set of cases where intentional misalignment serves a goal:
In production app UI, deliberate misalignment is rare. The default is strict alignment; deviation requires justification.
Elements share a vertical axis (a y-axis line). The most common form in UI work.
Elements share a horizontal axis (an x-axis line).
A grid imposes both vertical and horizontal alignment. Most modern web design uses 12-column grids (responsive: 12 columns for desktop, 6 for tablet, 4 for mobile).
.layout {
display: grid;
grid-template-columns: repeat(12, 1fr);
gap: 24px;
max-width: 1200px;
margin: 0 auto;
}
.layout > .main { grid-column: span 8; }
.layout > .sidebar { grid-column: span 4; }
Within a grid, every element's edges fall on grid columns (or align to multiples of the column width).
The mathematically-correct alignment doesn't always look right. Curved or pointed shapes (round buttons, triangular icons) need optical adjustment to look aligned with rectangular ones. Designers shift them by a pixel or two so they read as aligned.
<form style="display: grid; gap: 16px; max-width: 400px;">
<div class="field">
<label for="name">Full name</label>
<input id="name" type="text" />
</div>
<div class="field">
<label for="email">Email</label>
<input id="email" type="email" />
</div>
<div class="field">
<label for="phone">Phone</label>
<input id="phone" type="tel" />
</div>
<button type="submit">Submit</button>
</form>
<style>
.field { display: grid; gap: 4px; }
label, input, button { width: 100%; }
</style>
Every label, every input, the submit button — all share the same left edge and the same width. The eye reads it as a single coherent column. No alignment surprises.
A common pattern for dense forms, especially settings pages where the user scans labels:
<form style="display: grid; grid-template-columns: 8rem 1fr; gap: 12px 16px;">
<label style="text-align: right; padding-top: 0.5rem;">Display name</label>
<input type="text" />
<label style="text-align: right; padding-top: 0.5rem;">Email</label>
<input type="email" />
<label style="text-align: right; padding-top: 0.5rem;">Phone</label>
<input type="tel" />
</form>
Two columns: labels on the right, inputs on the left. Labels share a right-edge axis; inputs share a left-edge axis. The space between is the alignment gap. Scanning down either column is effortless.
<table>
<thead>
<tr>
<th style="text-align: left;">Customer</th>
<th style="text-align: right;">Amount</th>
<th style="text-align: right;">Days late</th>
</tr>
</thead>
<tbody>
<tr>
<td>Acme Co.</td>
<td style="text-align: right; font-variant-numeric: tabular-nums;">$2,480.00</td>
<td style="text-align: right; font-variant-numeric: tabular-nums;">14</td>
</tr>
<tr>
<td>Bright Labs</td>
<td style="text-align: right; font-variant-numeric: tabular-nums;">$98,001.50</td>
<td style="text-align: right; font-variant-numeric: tabular-nums;">3</td>
</tr>
</tbody>
</table>
Text columns left-align so the eye traces names. Numeric columns right-align with tabular numerals so digit positions stack — the eye can compare magnitudes by counting digits.
<header style="display: flex; align-items: center; justify-content: space-between;">
<div>
<h1 style="font-size: 1.5rem;">Invoices</h1>
<p style="color: hsl(0 0% 45%); font-size: 0.875rem;">Sent and overdue, this quarter.</p>
</div>
<div style="display: flex; gap: 8px;">
<button>Export</button>
<button class="primary">New invoice</button>
</div>
</header>
The header text is left-aligned; the action buttons are right-aligned (against the right edge of the page region). Both groups share the page's vertical center axis. Three alignment axes (left edge, center horizontal, right edge) all working at once.
<button class="rounded-button">
<svg viewBox="0 0 24 24" width="20" height="20" style="margin-left: -1px;">
<!-- A play icon (triangle) -->
</svg>
Play
</button>
A play triangle is mathematically centered in its viewBox but reads as slightly-too-far-right because the triangle's visual mass is offset. A 1px nudge left brings it into optical alignment. Many design systems handle this in their icon set; otherwise designers do it manually.
The most famous alignment failure in modern history. Palm Beach County, Florida used a "butterfly" ballot where candidate names were listed on facing pages with punch holes between. The misalignment between candidate text and punch positions was such that voters intending to vote for Al Gore (second candidate listed) frequently punched the second hole — which corresponded to Pat Buchanan, not Gore. Buchanan's vote count in Palm Beach County was statistically anomalous compared to surrounding counties; analysis suggested thousands of misvotes. The election was decided by 537 votes in Florida.
A design failure with material consequence. Lidwell, Holden, and Butler use this case as the canonical alignment example precisely because the stakes were so high.
Traditional newspapers use strict columnar grids. Headlines align to columns; body text wraps within column widths; photos crop to align with column edges. The discipline is what lets readers scan a dense front page in seconds.
The IRS 1040 form is a masterclass in alignment. Lines align across columns; figures align to decimal points; signature blocks align across pages. Without this discipline, the form would be unreadable; with it, millions of people complete it (with effort, but they complete it).
Cells align to a grid by definition. Spreadsheets succeed as a productivity tool partly because alignment is enforced at the data structure level. Word processors and HTML, by contrast, allow alignment to drift unless designers exercise discipline.
Manhattan's grid is alignment at city scale. Rome's organic streets are aligned to nothing. Both produce navigable cities, but they navigate differently — the grid is faster to learn; the organic is more interesting to walk.
good-continuation — alignment exploits good continuation; the eye threads along shared edges.hierarchy — alignment supports hierarchy by establishing the rhythm hierarchy varies against.proximity — proximity establishes grouping; alignment establishes the columns those groups inhabit.uniform-connectedness — aligned items connected by a shared axis read as a system.gutenberg-diagram — when alignment is uniform, the eye falls back to the Z-pattern.aesthetic-usability-effect (aesthetics) — alignment is a major component of "classical" aesthetics; misaligned designs are perceived as less usable even when they work.alignment-grid-systems — formal grid systems (12-column, modular grids, baseline grids) and how to use them.alignment-text-and-numerics — alignment decisions specific to text (left vs. center vs. justified) and to numeric tables (right-align, tabular numerals).Alignment is the cheapest design improvement available — it costs only attention, no new content. Yet it's one of the most-violated principles in production UIs because it's invisible when right and accumulates as drift when ignored. The discipline is in noticing every element's edge and asking: what does this align to? If the answer is "nothing," fix it.
Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
npx claudepluginhub hdeibler/universal-design-principles --plugin perception-and-hierarchy-principles