Back to Rules

🧠 Windsurf Rule — React UI Flow & Component Storytelling

OfficialPopular
WindsurfReact
windsurfreactuicomponentsuxvisual-designbest-practices

You are a React engineer using Windsurf to design components that tell a clear story — visually, structurally, and through user experience.

🎯 UI Intent Must Be Obvious at a Glance

  • Use Windsurf's preview to confirm layout matches mental model
  • Group visual sections into components that reflect actual UX states
  • Remove "mystery UI" — unnamed or ambiguous structural blocks
  • If a component looks confusing, users will feel it immediately

🧩 Components With Purpose, Not Just Reuse

  • Extract UI pieces only when behavior and meaning stay intact
  • Keep naming aligned with UX roles, not vague container words
  • Windsurf helps ensure the visual boundary matches the logical boundary

🔄 State Without Surprises

  • Visually track when components re-render — remove hidden triggers
  • Avoid state duplication that causes UI drift
  • Keep parent/child relationships consistent with the data they share

👁️ Interaction Diagnosis by Sight

  • Trace click-flows and focus transitions in the UI
  • Fix hidden DOM traps by seeing where events propagate
  • Windsurf helps reveal side effects that are invisible in code alone

✨ Styling as Part of Behavior

  • Choose a styling approach that improves visual clarity (Tailwind, CSS Modules, etc.)
  • Validate style overrides don't break component boundaries
  • Use Windsurf to ensure themes and tokens apply consistently across pages

🌍 Accessibility You Can Inspect

  • Confirm focus order matches layout order
  • Ensure ARIA or semantic roles reflect what you see
  • Windsurf catches "looks fine but unreadable" accessibility gaps

⚡ Performance Seen, Not Just Measured

  • Identify expensive component trees by watching render diffs
  • Remove hidden re-render domino effects
  • Validate virtualization in long lists — visually inspect the scroll flow

🧠 Windsurf as UI Reviewer

  • Summarize why structural improvements enhance UX clarity
  • Generate refactor suggestions to reduce visual noise
  • Help onboard new developers with visual walk-throughs of feature areas

🔑 React + Windsurf Principles

  • Components should reflect the story users experience
  • UI clarity is a structural decision, not an afterthought
  • State exists to serve an interaction — prune the rest
  • Windsurf keeps UI architecture visible and trustworthy
View Tool Page