Forms

Labels, validation and errors that help people finish, and never lose their work.

4 MUST3 SHOULDRaw markdown

Forms are where most products ask for effort. Every rule here exists to make that effort smaller and safer.

FORM-01 MUST

Every input has a visible label

Placeholder text disappears as soon as someone types, is usually low contrast, and is not a reliable label for screen readers.

✗ Don't

Use the placeholder as the only label, such as a lone "Email" inside the field.

✓ Do

Put a <label> above each field that stays visible while typing.

FORM-02 MUST

Validate when people leave a field, not while they type

An error that appears after the first character punishes people before they are done.

✗ Don't

Show "Invalid email" after the first keystroke.

✓ Do

Validate on blur and on submit. Once a field shows an error, re-check it live so the error clears the moment it is fixed.

FORM-03 MUST

Errors say what is wrong and how to fix it, next to the field

People fix what they can see. A vague message or a banner far from the field turns a typo into a search.

✗ Don't

Write "Invalid input", or show only a summary banner at the top of a long form.

✓ Do

Write "Password needs at least 8 characters" directly under the field and connect it with aria-describedby. On submit, move focus to the first field with an error.

FORM-04 MUST

Never lose what someone typed

A form that clears itself after an error is the fastest way to lose someone's trust.

✗ Don't

Reset the form when the server returns an error.

✓ Do

Keep every value after a failed submit. Warn before leaving a page with unsaved changes. Restore drafts for long forms.

FORM-05 SHOULD

Use the right input type and autocomplete

The right type gives mobile users the right keyboard, and autocomplete lets browsers and password managers fill fields for them.

✗ Don't

Make every field type="text", or turn autocomplete off on login forms.

✓ Do

Use type="email", inputmode="numeric", autocomplete="email" and autocomplete="one-time-code".

FORM-06 SHOULD

Ask only for what you need now

Every extra field lowers completion. Most can wait until the person actually needs the feature.

✗ Don't

Ask for a phone number, company size and job title just to create an account.

✓ Do

Move non-essential fields to later in the journey and mark optional fields "(optional)".

FORM-07 SHOULD

Group long forms into clear sections or steps

A long, undivided column of fields feels like more work than it is, and makes it hard to see what belongs together.

✗ Don't

Stack every field in one long column with equal spacing and no headings.

✓ Do

Group related fields under short headings (Contact, Shipping, Payment), or split long flows into steps with a progress indicator. Order fields so earlier answers narrow later ones, such as country before city.

States

Empty, loading, error and edge-case states, beyond the happy path that agents tend to stop at.

4 MUST1 SHOULDRaw markdown

AI agents usually build the screen with perfect data. Real people meet the empty, slow and broken versions first.

STATE-01 MUST

Design every view for empty, loading, error and success

The happy path is one state out of at least four. The missing ones are the ones people remember.

✗ Don't

Ship a list that only works once data exists.

✓ Do

Before calling a view done, build and preview its empty, loading, error and success states.

STATE-02 MUST

Empty states explain what goes here and offer the next step

An empty screen is a new user's first impression. It should teach, not shrug.

✗ Don't

Show a blank area, "No data" or a lonely table header.

✓ Do

Say what will appear and add the action that fills it, for example "No projects yet" with a "Create project" button.

STATE-03 MUST

Loading keeps the layout stable

Content that jumps as it loads makes people click the wrong thing and feels broken.

✗ Don't

Flash a spinner for 50 ms, or let content push the page down when it arrives.

✓ Do

Reserve space for content and images. Use skeletons shaped like the final layout for waits longer than about 300 ms.

STATE-04 MUST

Errors explain what happened and offer a way out

A dead end makes people leave. A clear message and a retry keeps them going.

✗ Don't

Show "Error 500", a stack trace or a white screen.

✓ Do

Say what failed in plain words, keep the rest of the page usable, and offer "Try again" or another route.

STATE-05 SHOULD

Handle real-world content

Demo data is short and tidy. Real names are long, lists hold a thousand items, and images fail to load.

✗ Don't

Let a long name break the layout or overlap buttons.

✓ Do

Test with 0, 1 and 1,000 items, 60-character names, missing images and large numbers. Truncate with a tooltip or wrap on purpose.

Feedback

Every action gets a response, and people always know whether something worked.

3 MUST1 SHOULDRaw markdown

People should never have to wonder whether a click registered, whether a save worked or whether they should click again.

FEED-01 MUST

Every action responds within 100 ms

Beyond roughly 100 ms, an interface stops feeling instant and people start to doubt that their click landed.

✗ Don't

Show nothing until the server answers.

✓ Do

Show a pressed state immediately. On submit, switch the button to a pending state with a spinner and keep its label.

FEED-02 MUST

Confirm completed actions in the action's own words

Consistent words teach people the product. "Publish" followed by "Published" closes the loop.

✗ Don't

Show a generic "Success!", or nothing at all.

✓ Do

After "Publish", show "Published", ideally with a link to the result.

FEED-03 MUST

Prevent double submission

An impatient double click should never create two orders or two charges.

✗ Don't

Leave the submit button active during the request.

✓ Do

Disable the action while it is pending, and make the server request idempotent where money or data is involved.

FEED-04 SHOULD

Show progress for anything longer than a few seconds

Around 10 seconds, people lose focus. Showing progress, and letting them do other things, keeps them in control.

✗ Don't

Show an endless spinner for a two-minute import.

✓ Do

Use determinate progress for uploads and imports. Let people leave the page and notify them when the task is done.

Accessibility

Contrast, keyboard, focus and alternatives, so the product works for everyone.

5 MUST1 SHOULDRaw markdown

These rules map to WCAG 2.2 level AA. They are the floor, not the goal.

A11Y-01 MUST

Text has enough contrast

Low contrast text is hard to read for many people, on every screen, in sunlight. (WCAG 1.4.3)

✗ Don't

Use light grey text on white for anything people need to read.

✓ Do

Use at least 4.5:1 for body text and 3:1 for large text (24 px, or 18.5 px bold) and for UI components.

A11Y-02 MUST

Everything works with a keyboard, and focus is visible

Keyboard and switch users need to reach every control, and see where they are. (WCAG 2.1.1, 2.4.7)

✗ Don't

Set outline: none without a replacement.

✓ Do

Use native controls, keep the tab order logical, and style :focus-visible with a clear outline.

A11Y-03 MUST

Images and icon buttons have text alternatives

A screen reader can't describe a picture or an icon it has no name for. (WCAG 1.1.1, 4.1.2)

✗ Don't

Ship an unlabeled trash-can button, or alt="image".

✓ Do

Give meaningful images descriptive alt text and decorative ones alt="". Give icon-only buttons an aria-label.

A11Y-04 MUST

Never rely on color alone

About 1 in 12 men have some form of color vision deficiency, and sunlight, grayscale mode and poor screens wash color out for everyone. (WCAG 1.4.1)

✗ Don't

Show status with a colored dot alone, or mark errors with only a red border.

✓ Do

Pair color with an icon and a word: a tick and "Paid", an alert and "Overdue", a clock and "Due soon".

A11Y-05 MUST

Dialogs manage focus

If focus escapes a modal, keyboard and screen reader users get lost behind it.

✗ Don't

Open a modal that leaves focus on the page behind it.

✓ Do

Move focus into the dialog when it opens, keep it inside, close on Escape, and return focus to the trigger.

A11Y-06 SHOULD

Respect reduced motion

Large or constant motion can cause nausea and distraction for people with vestibular disorders.

✗ Don't

Autoplay parallax or large movements with no way out.

✓ Do

Wrap non-essential animation in @media (prefers-reduced-motion: no-preference), or tone it down under reduce.

Content

Words that make the product easier to use, with clear actions, one name per thing, and plain language.

3 MUST2 SHOULDRaw markdown

Interface copy is design. Every word should help someone understand or act.

COPY-01 MUST

Buttons say what will happen

A specific verb tells people what they're committing to before they click.

✗ Don't

Write "Submit", "OK", "Continue" or "Click here" when a specific verb exists.

✓ Do

Write "Save changes", "Send invite" or "Create project".

COPY-02 MUST

One name for one thing

If the same thing is called a project in one place and a workspace in another, people assume they are two different things.

✗ Don't

Mix synonyms like "remove" and "delete", or "team" and "organization", for the same action or object.

✓ Do

Pick one term per concept and use it in nav, headings, buttons, toasts and emails.

COPY-03 SHOULD

Use the user's words, not the system's

People think in tasks, not in how the product is built.

✗ Don't

Show "Webhook config", "null" or "ERR_SYNC_409".

✓ Do

Write "Notifications" and "Couldn't save. Check your connection".

COPY-04 SHOULD

Write in sentence case and plain language

Sentence case reads faster than Title Case or ALL CAPS, and plain words work for everyone, including non-native speakers.

✗ Don't

Write "Change Your Password Now" or "Utilize the configuration panel".

✓ Do

Put the key words first, keep sentences short, and write "Change password".

COPY-05 MUST

Error messages explain, reassure and help, without blame

Errors are stressful moments. A vague or blaming message makes people feel stupid; a clear one keeps them going.

✗ Don't

Write "Error: invalid request", "You entered the wrong details" or "Something went wrong".

✓ Do

Say what happened and why, reassure where you can, and give the next step: "Your bank declined the payment. No money was taken. Try another card or contact your bank."

Destructive actions

Deleting, cancelling and other actions people can't easily take back.

3 MUST1 SHOULDRaw markdown

Mistakes happen. Good products make them cheap to undo, and hard to make when they can't be undone.

ACT-01 MUST

Make destructive actions look different and keep them apart

If "Delete" looks like "Save" and sits right next to it, someone will eventually click the wrong one.

✗ Don't

Put "Delete" and "Save" side by side in the same style.

✓ Do

Use a distinct destructive style, and place destructive actions away from primary ones, for example in a menu or a "Danger zone" section.

ACT-02 MUST

Offer undo where you can, confirm where you can't

Confirming everything trains people to click "Yes" without reading. Undo is faster and safer.

✗ Don't

Ask "Are you sure?" for every action, or delete permanently with no warning.

✓ Do

For reversible actions (archive, move to trash), act immediately and show an "Undo" toast. For irreversible actions, confirm first and name the object and the consequence.

ACT-03 MUST

Confirmation buttons name the action

"Yes" and "No" force people to re-read the question. "Delete project" doesn't.

✗ Don't

Label them "Yes" and "No", or "OK" and "Cancel".

✓ Do

Label the buttons "Delete project" and "Cancel".

ACT-04 SHOULD

Add friction in proportion to the stakes

Deleting a whole account or repository deserves a deliberate step that a routine action doesn't.

✗ Don't

Use the same one-click confirm for deleting a comment and deleting an account.

✓ Do

For high-stakes, irreversible actions, ask people to type the object's name to confirm.

Touch and responsive

Targets, zoom and layouts that hold up on small screens and real thumbs.

3 MUST2 SHOULDRaw markdown

Most people will meet the product on a phone first. Design for thumbs, small screens and bad connections.

TOUCH-01 MUST

Touch targets are at least 44 by 44 px

Small targets cause mis-taps, especially in lists of links or icon rows. WCAG 2.2 AA sets 24 by 24 px as the minimum, and 44 px matches Apple's guidelines.

✗ Don't

Ship 16 px icon buttons placed edge to edge.

✓ Do

Give every tappable element a hit area of at least 44 by 44 CSS px, ideally 48 by 48, with at least 8 px between neighbors.

TOUCH-02 MUST

Works at 320 px wide without horizontal scrolling

Small phones and 400% browser zoom both end up around 320 CSS px wide. (WCAG 1.4.10)

✗ Don't

Use fixed-width containers that push the page sideways.

✓ Do

Let layouts reflow into one column, wrap long words and make tables scroll inside their own container.

TOUCH-03 MUST

Never disable zoom

People with low vision rely on pinch-zoom. Blocking it locks them out. (WCAG 1.4.4)

✗ Don't

Add user-scalable=no or maximum-scale=1.

✓ Do

Use <meta name="viewport" content="width=device-width, initial-scale=1">. Set inputs to at least 16 px text so iOS doesn't auto-zoom them.

TOUCH-04 SHOULD

Keep primary actions within thumb reach

On large phones, the top corners are the hardest places to reach with one hand.

✗ Don't

Put the only "Save" button in the top-right corner of a long mobile form.

✓ Do

Put the main action of a mobile view near the bottom, for example as a sticky bottom bar or a bottom sheet.

TOUCH-05 SHOULD

Design first for the device where the core work happens

Mobile-first is a good default for quick interactions, but tools for writing, analysis or finance deliver most of their value on a large screen with a keyboard.

✗ Don't

Squeeze a spreadsheet-heavy finance tool into a phone layout first, just because "mobile-first" is the rule.

✓ Do

Decide where the most important task is done, design that experience first, then adapt it to the other devices.

Visual craft

Hierarchy, focus and restraint, and how to avoid the generic look of AI-made UI.

1 MUST7 SHOULDRaw markdown

Visual design is how people tell what matters. These rules are about clarity rather than taste. For brand and tokens, use your DESIGN.md.

VIS-01 MUST

One primary action per view

When everything is emphasized, nothing is. One clear primary action tells people what to do next.

✗ Don't

Put three filled buttons of the same color side by side.

✓ Do

Use one filled primary button per view or section, with secondary and tertiary styles for the rest.

VIS-02 SHOULD

Build hierarchy with size, weight and space before boxes and color

Borders, cards and colors added everywhere create noise. Space and type create order.

✗ Don't

Wrap every element in a card, or put cards inside cards.

✓ Do

Group related items with proximity, separate sections with whitespace, and rank content with type size and weight.

VIS-03 SHOULD

Use tokens, not one-off values

One-off spacing, colors and font sizes add up to an interface that feels slightly off everywhere.

✗ Don't

Hard-code margin: 13px or a hex color that isn't in the palette.

✓ Do

Take spacing, color, radius and type from the design tokens in DESIGN.md or your theme.

VIS-04 SHOULD

Avoid the generic AI look

People have learned to spot default AI-made UI, and it reads as low effort.

✗ Don't

Default to purple-blue gradients, emoji as icons, centered everything, glassmorphism or a sparkle icon on every feature.

✓ Do

Start from the product's own content and brand. Use icons from one consistent set.

VIS-05 SHOULD

Opening an overlay never shifts the page

Many modal and drawer libraries hide the scrollbar to stop the page scrolling. The page gets about 15 px wider and everything behind it jumps sideways.

✗ Don't

Lock scrolling with overflow: hidden and let the layout jump each time a modal opens and closes.

✓ Do

Reserve the scrollbar space once with html { scrollbar-gutter: stable; }, or compensate for the scrollbar width when locking scroll.

VIS-06 SHOULD

Name color tokens by their role, not their appearance

Names like blue-500 say what a color looks like, not when to use it, so people guess, and the palette drifts.

✗ Don't

Reference raw palette colors like blue-500 or grey-100 directly in components.

✓ Do

Name tokens by element and purpose, such as text.danger, surface.subtle or border.accent.strong (element, tone, emphasis, state, at most four parts).

VIS-07 SHOULD

Put actions close to what they act on

Fitts's law: the farther and smaller a target, the longer it takes to reach. Actions far from the content make people hunt and travel.

✗ Don't

Put the only "Save" button in the top corner, far from the end of a long form.

✓ Do

Place the submit button right after the last field, and row actions on the row itself. Make frequent actions larger and easier to reach.

VIS-08 SHOULD

Align everything to a consistent grid

Edges that almost line up look accidental. A shared grid makes layouts feel calm, consistent and professional.

✗ Don't

Nudge elements a few pixels by eye, so left edges and gaps drift between sections.

✓ Do

Use a column grid and a spacing scale, and align text, inputs and cards to the same edges.