Multi-page routes & forms

Design clean multi-page navigation, multi-step wizards, dual client-and-server form validation, and URL-backed state so users never lose progress.

Prototypes often stack everything onto one scrolling page with tabs toggled in memory. That breaks down once your product adds public marketing pages, sign-in, member settings, billing, and an admin panel.

Production software treats routes as contracts. Every primary screen owns a clear URL, enforces role rules on the server, respects browser Back and Forward history, and handles missing pages or signed-out deep links cleanly without blank screens.

In ExaSpark, declaring routes and validation rules plainly lets the Agent wire routing, server checks, and Cloud persistence together.

Choosing the right navigation and flow pattern

Pick the navigation shell that fits how people use your product rather than cramming every screen into one crowded top bar.

Product surfaceRecommended navigationClean URL structureMobile adaptation
Public site or storefrontMinimal top header (4–5 links) + footer/, /pricing, /classes, /classes/:idCompact header with slide-over menu drawer
Daily member workspace (App)Left sidebar on desktop; bottom tabs on mobile/dashboard, /bookings, /messages, /account4–5 item bottom tab bar with safe-area padding
Onboarding or checkout wizardFocused distraction-free shell with step count/book/:id?step=2 or /onboarding?step=1Sticky step progress bar + Back / Continue footer
Detail page with sub-viewsBreadcrumb back link + inner horizontal tabs/projects/:id/tasks, /projects/:id/filesScrollable tab strip + crisp back chevron
Admin back-officeRole-gated /admin layout distinct from public UI/admin/overview, /admin/orders, /admin/membersCollapsible drawer prioritizing search and filters

Designing forms and multi-step wizards users finish

Forms are where bookings, sign-ups, and payments either convert cleanly or silently lose customers.

Single-page forms vs multi-step wizards

Keep quick actions — sign-in, contact inquiries, or profile updates (1–5 fields) — on one vertical screen with crisp labels.

Split longer workflows — client intake, custom quotes, or multi-session booking checkout (8+ fields) — into a 3 to 4 step wizard:

  • Group by mental task. Step 1 picks service and time; Step 2 collects contact details; Step 3 reviews totals and completes Stripe checkout.
  • Show clear progress. Display "Step 2 of 3 — Contact details" and let users step back without losing entered values.
  • Keep one clear primary button. Place Back as a quiet link and Continue or Confirm & Pay as the unmistakable primary CTA.

Dual client and server validation

Never rely solely on browser validation, and never make users wait for a network trip to catch a missing @ in their email.

  • Client validation for immediate guidance. Validate required inputs, email syntax, and ranges inline on blur or submit. Place concise red messages directly under the offending input rather than in a vague top banner.
  • Server validation for data integrity. Re-validate every payload server-side before writing to Cloud — checking capacity limits, role ownership, duplicate bookings, and pricing IDs so stale tabs or tampered requests never corrupt live records.

Preserve progress, stop double submits, and confirm cleanly

Losing typed inputs on a validation error — or creating duplicate bookings when tapping Pay twice on mobile — breaks trust immediately.

  • Keep entered inputs on error. Retain every valid field when validation fails and shift focus smoothly to the first invalid input.
  • Lock buttons while pending. Switch submit into a disabled loading state ("Saving...") backed by server duplicate protection.
  • Apply optimistic UI carefully. Use instant updates for lightweight toggles (bookmarks, task checkboxes) with automatic rollback on failure; always wait for server confirmation on Stripe payments.

URL state: filters, tabs, search, and pagination

Storing search queries, category filters, sort order, or page numbers strictly in local component state feels fragile: refreshing wipes the view, hitting Back from a detail page resets filters, and teammates cannot share filtered links.

Mirroring shareable view state in URL query parameters solves all three problems. Here is a URL map for a booking and membership app:

text
Public Discovery Routes:
  /                                   → Homepage hero & overview
  /classes?day=thu&level=beginner     → Filterable schedule (URL state)
  /classes/:slug                      → Class details & live seat count
  /pricing                            → Memberships & class packs

Member Routes (signed-out visits redirect to /login?next=<path>):
  /book/:classId?step=2               → Multi-step booking & Stripe deposit
  /account/bookings?tab=upcoming      → Member history with URL-backed tabs
  /account/billing                    → Active plan + Manage Billing link

Admin Routes (server enforces Admin role):
  /admin/orders?status=pending&page=2 → Shareable paginated orders table
  /admin/classes/new                  → Create class form with unsaved guard
  /404                                → Branded Not Found page with Home link

Notice /login?next=<path>: when a signed-out member clicks an email link to /account/bookings, signing in returns them straight to that screen instead of stranding them on /.

Building a rock-solid multi-step flow in ExaSpark

Follow this five-step workflow to ship durable multi-page navigation and forms.

  1. Map routes and role gates upfront

    Name public, member, and admin paths explicitly in your prompt or PROJECT_RULES.md so redirects and server checks match from turn one.

  2. Bind every input to Cloud columns

    Specify required fields, types, and formats so frontend inputs, API checks, and relational Cloud tables stay aligned.

  3. Add wizard draft saving and double-submit locks

    Persist multi-step drafts across step navigation and reloads (clearing on success) and disable buttons while requests run.

  4. Move filters, tabs, and pagination into URL params

    Sync search and list filters to the query string so browser Back and shared links preserve exact views.

  5. Stress-test edge cases in Preview

    Submit blank forms, double-click submit buttons, open /account while signed out, and press browser Back mid-wizard before clicking Publish.

Build a resilient multi-step intake and booking wizard cleanly:

Starter prompt · App

Build a 3-step booking wizard at /book/:serviceId (Step 1: pick date and time slot with live Cloud capacity check; Step 2: client name, email, phone, and optional notes; Step 3: review summary and pay Stripe deposit). Validate inline per step and enforce identical validation server-side before saving. Preserve draft inputs when stepping back or refreshing, disable submit buttons while pending to stop duplicate Cloud rows, and clear the draft on confirmation.

Upgrade an existing storefront or admin table with URL-backed filters, ?next= login redirects, and branded 404 handling:

Starter prompt · Web

Upgrade routing and list state on our catalog and /admin/orders views: store search query, status filter, sort order, and page number in URL query parameters so reloads and browser Back preserve the exact view. Add ?next= return redirects when signed-out users open protected /account URLs, and add a branded 404 page linking back to Home and Schedule. Leave Cloud schemas and Stripe handlers unchanged.

Common routing and form failures

Eliminate these six recurring multi-page bugs during Preview testing.

SymptomRoot causeExact fix
Pressing Back on Step 2 wipes Step 1 inputsValues lived inside unmounted child step stateLift wizard state to a parent store or draft storage cleared only on final success
Double-tapping Submit creates duplicate Cloud rowsSubmit stayed enabled during the network requestDisable submit with a loading label immediately and add server duplicate protection
Form passes browser checks yet fails silentlyAPI rejected the payload without displaying server errorsReturn structured field-level errors from the API and render inline messages
Refreshing a filtered list resets to page 1Filters lived in memory instead of URL query paramsStore search, filter, sort, and page values in URL params (?status=paid&page=2)
Protected route hits a signed-out redirect loopAuth guard redirected before session loading finishedWait for auth session resolution, then redirect to /login?next=<path>
Validation error hides off-screen on mobileFailed submission did not move viewport or focusScroll smoothly to and focus the first invalid field automatically

Next steps

Still have a question?Ask our team and other builders on Discord.

From the blog