Documentation / Product UI

Forms, input and validation

Load for sign-up, checkout, settings, onboarding, search, filters, multi-step flows and any screen where people type or choose.

skills/design-skill/references/forms.md

Load for sign-up, checkout, settings, onboarding, search, filters, multi-step flows and any screen where people type or choose. Pair with UX writing for labels and error text and accessibility. Requirement = correctness/accessibility obligation; Pattern = adaptable starting point; Taste hypothesis = design judgment to validate in context.

1. Fields

Every field has a persistent label

  • Confidence Level: Requirement
  • Purpose: Keep the question visible while answering it.
  • Reasoning: Placeholder-only fields lose their label on the first keystroke, fail screen readers and look filled-in when empty.
  • Constraint: A visible <label for> above the field (top-aligned labels scan fastest). Help text sits between label and field or below it, linked with aria-describedby. Placeholders show an example format only ("name@company.com"), never the label or instructions. Mark the minority: if most fields are required, mark optional ones "(optional)"; otherwise mark required ones, and set required/aria-required.
  • Example:
    • Bad: A grey "Email" placeholder that vanishes, asterisks with no legend.
    • Good: Label "Work email", hint "We'll send the invite here", placeholder "you@company.com".
  • Exceptions: A single search field with a visible search button and an accessible name may omit the visible label.

Use the right input

  • Confidence Level: Requirement
  • Purpose: Get the right keyboard, autofill and validation for free.
  • Reasoning: Browsers and password managers already solve most input problems when given the correct attributes.
  • Constraint: Set type (email, tel, url, number only for quantities, password, search, date where the native picker suits the audience), inputmode (numeric for codes and card numbers, decimal for amounts), and autocomplete tokens (name, email, street-address, postal-code, cc-number, one-time-code, new-password, current-password). Never block paste. Use spellcheck="false" and autocapitalize="off" for usernames, codes and emails.
  • Example:
    • Bad: type="number" for a card number, which strips leading zeros and shows spinners.
    • Good: type="text" inputmode="numeric" autocomplete="cc-number".
  • Exceptions: None for autocomplete on personal data fields.

Choose controls by number of options

  • Confidence Level: Pattern
  • Purpose: Minimise effort per choice.
  • Reasoning: A dropdown hides two options behind an extra click; radio buttons for forty countries are unreadable.
  • Constraint: 2 options: switch (immediate effect) or radio/segmented control (submitted with the form). 3–6: radio group or segmented control, all visible. 7–15: select. More than 15 or searchable data: combobox with type-ahead. Multiple choice: checkboxes (few) or multi-select combobox with chips (many). Dates: three fields or a text field for known dates (birthdays), a calendar picker for nearby dates (bookings). Size fields to the expected input (postcode short, address long).
  • Exceptions: Brand or space constraints may justify a select for 4–6 options on mobile.

2. Validation

Validate at the right moment

  • Confidence Level: Requirement
  • Purpose: Catch errors early without nagging.
  • Reasoning: Errors on every keystroke punish people mid-typing; errors only after submit send them hunting.
  • Constraint: Validate a field on blur once it has been touched, then live on input while it is invalid so the error clears as soon as it is fixed. Validate everything on submit. Never disable the submit button to signal invalid input; let people submit and show what is wrong. Show server errors (taken username, declined card) next to the relevant field. Keep entered values after any error, including server errors and page reloads where possible.
  • Example:
    • Bad: "Invalid email" appears after typing "j", and the greyed-out Submit gives no reason.
    • Good: On blur, "Enter an email address like name@example.com"; it disappears the moment the address becomes valid.
  • Exceptions: Password strength meters and character counters may update live from the first keystroke.

Write errors that fix themselves

  • Confidence Level: Requirement
  • Purpose: Tell people exactly how to recover.
  • Reasoning: "Invalid input" is a judgment, not an instruction.
  • Constraint: Error text says what to do, in plain words, next to the field, in the danger colour with an icon (never colour alone), linked with aria-describedby and aria-invalid="true". On submit with errors, move focus to the first invalid field, or to an error summary at the top for long forms, listing each error as a link to its field. Accept flexible formats (spaces in phone and card numbers, any case in emails) and normalise them yourself rather than rejecting them.
  • Example:
    • Bad: "Error: field 3 format invalid".
    • Good: "Enter the date as DD/MM/YYYY, for example 07/03/1990".
  • Exceptions: Security-sensitive errors (login) stay generic: "Email or password is incorrect".

3. Structure and flow

Fewer fields, logical groups

  • Confidence Level: Pattern
  • Purpose: Reduce abandonment.
  • Reasoning: Each field costs attention; unexplained fields cost trust.
  • Constraint: Remove every field you cannot justify; ask later for anything not needed now. One column for most forms (multi-column only for tightly related short fields such as city/postcode or first/last name). Group related fields with <fieldset> and <legend>. Order fields the way people think (name before address before payment). Explain why you ask for sensitive data next to the field.
  • Exceptions: Dense internal admin forms may use two columns at wide widths.

Multi-step flows

  • Confidence Level: Pattern
  • Purpose: Make long processes feel finite and safe.
  • Reasoning: People abandon flows when they cannot see the end or fear losing work.
  • Constraint: Split by topic, not by an arbitrary field count. Show progress as named steps ("Account · Workspace · Invite"), not only a percentage. Allow Back without losing data, save drafts automatically for long flows, and show a review step before irreversible submission. The primary button names the next step ("Continue to payment"), the last one names the outcome ("Pay $48").
  • Exceptions: Two or three short questions fit on one page.

Buttons and submission

  • Confidence Level: Requirement
  • Purpose: Prevent double submits and ambiguity.
  • Reasoning: Slow networks turn impatient clicks into duplicate orders.
  • Constraint: One primary button per form, labelled with the specific action ("Create project", not "Submit"). While submitting, keep the label width stable, show an inline spinner, set aria-busy and ignore further clicks; re-enable on failure. Enter submits single-line forms. Cancel is a secondary or text button, placed consistently. Confirm success with the result, not just a toast ("Project created" and the project open).
  • Exceptions: Instant-save settings have no submit button.

4. Special inputs

Input Do
Password Show/hide toggle with an accessible name; show requirements up front and tick them live; allow paste and password managers; autocomplete="new-password" on sign-up.
One-time code One field (autocomplete="one-time-code", inputmode="numeric"), or segmented boxes that accept paste of the full code and move focus automatically; offer resend with a countdown.
Search type="search", a clear button, results that update after a short debounce (150–300ms) or on Enter, and a "No results for 'x'" state with suggestions.
File upload A real button plus drop zone; state accepted types and size limit before upload; show per-file progress, errors and remove; keep the file list after validation errors.
Money Currency symbol as a prefix outside the editable text, inputmode="decimal", format on blur, store minor units.
Phone One field accepting any formatting, with a country selector defaulting from locale.
Address Autocomplete where available, always with a manual entry fallback; country first because it changes the remaining fields.
Toggles A switch means immediate effect; label states what is on ("Email me weekly reports"), not "Enable".

5. Forms checklist

  1. Every field has a visible label, correct type, inputmode and autocomplete.
  2. Required/optional marked consistently; hints linked with aria-describedby.
  3. Errors appear on blur/submit, explain the fix, use icon plus text, and focus moves to the first error.
  4. Values survive errors; submit is never disabled to signal invalidity; double-submit is prevented.
  5. Keyboard only: tab order matches visual order, Enter submits, custom controls work with arrows and Space.
  6. Zoom to 200% and 320px width: labels, errors and buttons still visible without horizontal scroll.
  7. Success state confirms the actual result.

Guides & section titles

IntroductionWhat Design Skill does and when to use it.What is Design Skill?IntroductionHow to think about itIntroductionStart buildingIntroductionInstallationAdd Design Skill to your coding assistant.Install with the skills CLIInstallationInstall from a local checkoutInstallationVerify the installationInstallationDesign workflowFrom understanding the product to inspecting the result.Understand and chooseDesign workflowCompose and expressDesign workflowBuild and interactDesign workflowVerify and reviseDesign workflowCommands & promptsWays to ask your assistant to use Design Skill.Request conventionsCommands & promptsAn example briefCommands & promptsGuidance & exceptionsUnderstand requirements, patterns and design judgment.Instruction rolesGuidance & exceptionsWhen to break a patternGuidance & exceptionsResearch with referencesGuidance & exceptionsSkill filesRead the actual Markdown included in the skill.Explore the sourceSkill filesLoad guidance selectivelySkill filesSkill libraryEvery file in the skill, rendered from the same Markdown and CSS your assistant reads.Start hereSkill libraryDirection & compositionSkill libraryVisual craftSkill libraryProduct UISkill libraryBuild & behaviorSkill libraryQualitySkill libraryCSS kitsSkill libraryCustomizationAdapt Design Skill to your brand and project.Bring your own directionCustomizationWrite useful constraintsCustomizationPair with Glaze componentsCustomizationTroubleshootingResolve installation, discovery and output issues.The assistant cannot find Design SkillTroubleshootingThe result feels genericTroubleshootingCopy or theme is unavailableTroubleshootingVerificationCheck the implementation and report evidence honestly.Before shippingVerificationEvaluating the skillVerificationCurrent evidence limitsVerificationSources & licenseAttribution, license and reference use.Source acknowledgmentsSources & licenseMIT licenseSources & licenseSKILL.mdThe entry point: workflow, instruction roles, what to load when and the four request modes.Instruction rolesSKILL.mdWorkflowSKILL.mdLoad selectivelySKILL.mdCommands (assistant request conventions)SKILL.mdCoherence without samenessSKILL.mdCategory playbookLoad at the start of any landing, marketing or brand page.Technical productsCategory playbookConsumer apps and servicesCategory playbookCommerceCategory playbookLocal businesses and servicesCategory playbookCreative work and peopleCategory playbookEvents, community and causesCategory playbookCombining rowsCategory playbookStyle directionsLoad after the category playbook suggests directions, or whenever a page needs a defined look.1. Clean productStyle directions2. Dark technicalStyle directions3. Luminous AIStyle directions4. EditorialStyle directions5. Warm organicStyle directions6. Luxury refinedStyle directions7. Bold expressiveStyle directions8. PlayfulStyle directions9. Brutalist rawStyle directions10. Retro nostalgicStyle directions11. Trust and clarityStyle directions12. Cinematic immersiveStyle directions13. Commerce catalogStyle directionsLanding page compositionLoad when building or redesigning a landing, marketing, launch or waitlist page.Pick one hero patternLanding page compositionHero anatomyLanding page compositionSection libraryLanding page compositionBento gridsLanding page compositionKeep it honestLanding page compositionLanding-page reference researchLoad when exploring reference libraries or real landing pages to inform a composition.Research the question, not the trendLanding-page reference researchTranslate observation into a decisionLanding-page reference researchCompose around evidenceLanding-page reference researchKeep rights separate from inspirationLanding-page reference researchOptional research sourcesLanding-page reference researchDirection, composition and assetsLoad when choosing a visual direction, comparing compositions or sourcing images, fonts and other assets.Compare meaningful directionsDirection, composition and assetsChoose a personality carrierDirection, composition and assetsUse references responsiblyDirection, composition and assetsComposition and layoutLoad when setting hierarchy, proportions, density and depth on any screen.Compose before polishingComposition and layoutCoherent roles, varied screensComposition and layoutDepth must preserve usabilityComposition and layoutVisual craft baselineLoad for any marketing page, landing page, portfolio or product screen where visual quality matters, and whenever the project has no established design system.1. TypographyVisual craft baseline2. Space and layoutVisual craft baseline3. SurfacesVisual craft baseline4. ColourVisual craft baseline5. ControlsVisual craft baseline6. The visualVisual craft baseline7. Motion detailVisual craft baseline8. Craft checklist before shippingVisual craft baselineStarter kitLoad when building a landing page, marketing page or product screen without an existing design system.TokensStarter kitComponentsStarter kitHero markupStarter kitSectionsStarter kitProduct kitStarter kitTailwind mappingStarter kitAfter buildingStarter kitTypographyLoad when choosing typefaces, setting type hierarchy and rhythm, or loading fonts.Choose for actual contentTypographySet hierarchy and rhythmTypographyLoad fonts responsiblyTypographyColor roles and contrastLoad when defining colour roles, palettes, contrast or light and dark themes.Choose roles before countsColor roles and contrastMeasure contrast in contextColor roles and contrastDeliberate themesColor roles and contrastBuild palettes systematicallyColor roles and contrastDesign tokens, theming and dark modeLoad when setting up or extending a design system, adding dark mode or themes, mapping a design into Tailwind/shadcn/CSS variables, or auditing hard-coded values.1. Token architectureDesign tokens, theming and dark mode2. Colour scalesDesign tokens, theming and dark mode3. Dark modeDesign tokens, theming and dark mode4. Mapping tokens into common stacksDesign tokens, theming and dark mode5. Tokens checklistDesign tokens, theming and dark modeIcons, images and mediaLoad when choosing icons, placing photography, screenshots, logos, avatars, video or illustration, and when optimising media.1. IconsIcons, images and media2. Images and photographyIcons, images and media3. Logos, avatars and brand marksIcons, images and media4. Delivering mediaIcons, images and media5. Media checklistIcons, images and mediaBackgrounds and surfacesLoad when choosing page surfaces, background imagery, gradients or textures.Choose from the contentBackgrounds and surfacesLayer without obscuringBackgrounds and surfacesProduct UI: apps, dashboards and toolsLoad for any logged-in product surface: web apps, dashboards, admin panels, internal tools, settings, editors, developer tools and data-heavy screens.1. Start from the jobProduct UI: apps, dashboards and tools2. The app shellProduct UI: apps, dashboards and tools3. Common screensProduct UI: apps, dashboards and tools4. Feedback and system statusProduct UI: apps, dashboards and tools5. Product craft checklistProduct UI: apps, dashboards and toolsForms, input and validationLoad for sign-up, checkout, settings, onboarding, search, filters, multi-step flows and any screen where people type or choose.1. FieldsForms, input and validation2. ValidationForms, input and validation3. Structure and flowForms, input and validation4. Special inputsForms, input and validation5. Forms checklistForms, input and validationData visualizationLoad for charts, KPI tiles, sparklines, maps, reports and any screen that turns numbers into a judgment.1. Choose the form from the questionData visualization2. Encoding and honestyData visualization3. Colour for dataData visualization4. Numbers and labelsData visualization5. Interaction and accessData visualization6. Data visualization checklistData visualizationComponents and interaction statesLoad when designing or reviewing individual components and their interaction states.Choose structure from the taskComponents and interaction statesState behavior is part of designComponents and interaction statesFocused patterns (adapt to actual content)Components and interaction statesUX writing and contentLoad whenever the interface has words: headlines, buttons, labels, errors, empty states, notifications, onboarding, pricing and confirmation dialogs.1. Real words firstUX writing and content2. Interface textUX writing and content3. Voice, tone and formatUX writing and content4. Internationalisation-ready copyUX writing and content5. UX writing checklistUX writing and contentFunctioning implementationLoad when building UI in code: states, data flow, persistence and project boundaries.Build the whole relevant flowFunctioning implementationKeep state and response coherentFunctioning implementationRespect provenance and project boundariesFunctioning implementationConditional stack guidanceLoad when the work touches a specific stack such as React, Next.js, Vue, Svelte, Tailwind or shadcn/ui.Use the actual projectConditional stack guidanceFramework-specific implementationConditional stack guidanceInteraction and motionLoad when adding transitions, animation, gestures or any movement.Decide whether to animateInteraction and motionHandle interruption and originsInteraction and motionGestures and reduced motionInteraction and motionMeasure animation performanceInteraction and motionResponsive behaviorLoad when making layouts work across widths, zoom levels, touch and long content.Break at content pressureResponsive behaviorOverflow deliberatelyResponsive behaviorMobile navigation and touchResponsive behaviorAccessibilityLoad for every interface: keyboard, focus, semantics, names, contrast, targets and user preferences.Concrete patternsAccessibilityAccessibility checklistAccessibilityFrontend performanceLoad when building pages that must feel fast, adding fonts, images, video, shaders or heavy client code, or when an audit reports slowness.1. TargetsFrontend performance2. Loading (LCP)Frontend performance3. Stability (CLS)Frontend performance4. Responsiveness (INP)Frontend performance5. Weight and effectsFrontend performance6. Performance checklistFrontend performanceAvoid unconsidered defaultsLoad when output risks looking generic, or when reviewing for unconsidered defaults.Question defaults, not vocabulariesAvoid unconsidered defaultsShow something trueAvoid unconsidered defaultsEarn the decorationAvoid unconsidered defaultsCommon tells of unconsidered outputAvoid unconsidered defaultsVerify rendered resultsLoad before reporting work as done: rendered checks, measurement and honest evidence.Inspect, revise, repeatVerify rendered resultsMeasure and qualifyVerify rendered resultsEvaluate the skill fairlyVerify rendered resultsAudit rubricLoad for /design-skill audit, design reviews, pre-launch checks and "why does this look off?" questions.1. How to auditAudit rubric2. What to scoreAudit rubric3. SeverityAudit rubric4. Report formatAudit rubric5. Quick triage (five-minute pass)Audit rubricstarter.cssLanding-page kit: tokens, header, hero, frames, bento, pricing, FAQ, footer and twelve direction presets.How to usestarter.cssSourcestarter.cssproduct.cssProduct kit: app shell, forms, tables, badges, alerts, tabs, dialogs, toasts, density modes and dark tokens.How to useproduct.cssSourceproduct.css
Tab to move · Enter to open · Esc to close