softr-vibe-coding 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,746 @@
1
+ # Softr Vibe Coding — UI/UX Design Guidelines
2
+
3
+ These guidelines apply to every Softr Vibe Coding block. Follow them when building any user-facing component.
4
+
5
+ ## Table of Contents
6
+
7
+ 1. [Core Philosophy: Don't Make Me Think](#1-core-philosophy-dont-make-me-think)
8
+ 2. [Design Direction Before Code](#2-design-direction-before-code)
9
+ 3. [Visibility of Interactive Elements](#3-visibility-of-interactive-elements)
10
+ 4. [Visual Hierarchy](#4-visual-hierarchy)
11
+ 5. [Color Usage](#5-color-usage)
12
+ 6. [Typography](#6-typography)
13
+ 7. [Spacing: The 4pt Scale](#7-spacing-the-4pt-scale)
14
+ 8. [Cards: Use with Restraint](#8-cards-use-with-restraint)
15
+ 9. [Motion Design](#9-motion-design)
16
+ 10. [Buttons and Interactive Controls](#10-buttons-and-interactive-controls)
17
+ 11. [Forms and Input Fields](#11-forms-and-input-fields)
18
+ 12. [Loading States](#12-loading-states)
19
+ 13. [Empty States](#13-empty-states)
20
+ 14. [Feedback and Microinteractions](#14-feedback-and-microinteractions)
21
+ 15. [Error Prevention and Destructive Actions](#15-error-prevention-and-destructive-actions)
22
+ 16. [Progressive Disclosure](#16-progressive-disclosure)
23
+ 17. [Navigation and Orientation](#17-navigation-and-orientation)
24
+ 18. [Data Tables and Lists](#18-data-tables-and-lists)
25
+ 19. [KPI / Metric Cards and Dashboards](#19-kpi--metric-cards-and-dashboards)
26
+ 20. [Accessibility Baseline](#20-accessibility-baseline)
27
+ 21. [Mobile-First Responsive Design](#21-mobile-first-responsive-design)
28
+ 22. [UX Writing (Microcopy)](#22-ux-writing-microcopy)
29
+ 23. [Conventions and Consistency](#23-conventions-and-consistency)
30
+ 24. [Calculator and Utility Tool Polish](#24-calculator-and-utility-tool-polish)
31
+ 25. [AI Slop Anti-Pattern Checklist](#25-ai-slop-anti-pattern-checklist)
32
+ 26. [Finishing Touches](#26-finishing-touches)
33
+ - [Appendix A: Quick Reference](#appendix-a-quick-reference)
34
+ - [Appendix B: Motion and Spacing Tokens](#appendix-b-motion-and-spacing-tokens)
35
+ - [Appendix C: Design Brief Template](#appendix-c-design-brief-template)
36
+
37
+ ---
38
+
39
+ ## 1. Core Philosophy: Don't Make Me Think
40
+
41
+ The overriding principle of every interface is **eliminate question marks**. Every element on a screen should be self-evident — the user should never have to wonder what something is, whether it is clickable, or what will happen if they interact with it.
42
+
43
+ **Apply this by asking:** *"Would a first-time user of this interface understand what to do within 3 seconds, without reading any instructions?"*
44
+
45
+ Key implications:
46
+ - Use clear, literal labels. Avoid clever or internal names. "First Name" beats "Display Identifier". "Save" beats "Commit Changes."
47
+ - Every interactive element must *look interactive*. Buttons must look like buttons. Links must look like links.
48
+ - If something is not clickable, it must not look clickable.
49
+ - The most important action on any screen should be the most visually prominent element.
50
+
51
+ ---
52
+
53
+ ## 2. Design Direction Before Code
54
+
55
+ Most AI-generated UIs fail because of skipped thinking, not bad code. Jumping to "here's a card grid" without asking "what is the user trying to accomplish?" produces generic output every time.
56
+
57
+ **Before writing any block, establish:**
58
+ - **Target audience**: Who uses this? Role, context, frequency, emotional state when they arrive.
59
+ - **Primary user action**: The single most important thing a user should do or understand.
60
+ - **Brand personality**: Pick a clear direction — 3 concrete brand voice words (NOT "modern" or "elegant"; those are dead categories). Think of the brand as a *physical object*: a museum exhibit caption, a hand-painted shop sign, a 1970s mainframe manual.
61
+ - **Anti-goals**: What should this NOT be? What's the biggest risk of getting this wrong?
62
+
63
+ This context cannot be inferred from the codebase. Ask the user.
64
+
65
+ ---
66
+
67
+ ## 3. Visibility of Interactive Elements
68
+
69
+ **Never hide interactive controls behind hover-only states for primary or frequently used actions.**
70
+
71
+ A faint pencil icon that only appears on hover is one of the most common UX failures. Users who do not know to hover will never discover the action.
72
+
73
+ ### Rules:
74
+ - **Always-visible edit triggers:** Show edit icons permanently visible (not only on hover). Use `text-muted-foreground` for subtlety, but always render in the DOM.
75
+ - **Hover enhancement, not hover-only reveal:** Enhance on hover (e.g., increase opacity from 70% to 100%, change to `text-primary`), but the control must be visible *before* hover.
76
+ - **Touch devices have no hover.** Any action hidden behind a hover state is invisible to all mobile and tablet users.
77
+
78
+ ### Correct pattern (editable field):
79
+ ```jsx
80
+ <div className="flex items-center gap-2 group">
81
+ <span className="text-foreground">{value}</span>
82
+ <button
83
+ onClick={function() { setEditing(true); }}
84
+ className="text-muted-foreground hover:text-primary transition-colors"
85
+ aria-label="Edit field"
86
+ >
87
+ <Pencil className="w-4 h-4" />
88
+ </button>
89
+ </div>
90
+ ```
91
+
92
+ ### Editing state:
93
+ ```jsx
94
+ <div className="flex items-center gap-2">
95
+ <Input value={draft} onChange={function(e) { setDraft(e.target.value); }} autoFocus />
96
+ <button onClick={handleSave} aria-label="Save"><Check className="w-4 h-4 text-primary" /></button>
97
+ <button onClick={handleCancel} aria-label="Cancel"><X className="w-4 h-4 text-muted-foreground" /></button>
98
+ </div>
99
+ ```
100
+
101
+ ---
102
+
103
+ ## 4. Visual Hierarchy
104
+
105
+ Every screen must have a clear visual hierarchy that tells the user what is most important without thinking.
106
+
107
+ ### Hierarchy tools (use multiple together):
108
+
109
+ | Tool | Strong Hierarchy | Weak Hierarchy |
110
+ |---|---|---|
111
+ | **Size** | 3:1 ratio or more between heading and body | < 2:1 ratio — looks flat |
112
+ | **Weight** | Bold vs Regular with clear contrast | Medium vs Regular — indistinguishable |
113
+ | **Color** | High contrast foreground vs muted | Similar tones throughout |
114
+ | **Position** | Critical info top-left (LTR), secondary below | Everything center-aligned |
115
+ | **Space** | Surrounded by generous white space | Crowded, uniform padding |
116
+
117
+ ### The Squint Test
118
+
119
+ Blur your eyes or apply a blur filter to a screenshot. Can you still identify the most important element? The second most important? Clear groupings? If everything looks the same weight blurred, there is a hierarchy problem.
120
+
121
+ ### Rules:
122
+ - **No flat design:** Not everything can be the same visual weight. Pick one primary action per screen and make it stand out.
123
+ - **Limit contrast levels to 3:** Primary content, secondary content, disabled/muted. More than 3 creates visual chaos.
124
+ - **Bold only key values**, not labels. Users scan for numbers and data, not label text.
125
+ - Group related elements visually (`Card` wrappers, `gap` spacing, or `Separator` components). Spatial proximity signals relationship.
126
+ - The most critical information belongs in the **top-left quadrant** of the screen where the eye naturally lands.
127
+
128
+ ---
129
+
130
+ ## 5. Color Usage
131
+
132
+ ### The 60-30-10 Rule (Visual Weight, Not Pixel Count)
133
+
134
+ | Proportion | Role | Tailwind tokens |
135
+ |---|---|---|
136
+ | **60%** | Dominant / Background | `bg-background`, `bg-card` |
137
+ | **30%** | Secondary / Structure | `bg-muted`, `bg-secondary`, navigation, sidebars |
138
+ | **10%** | Accent / CTAs / Highlights | `bg-primary`, `text-primary`, `bg-destructive` |
139
+
140
+ Accents work *because* they are rare. Overuse kills their power.
141
+
142
+ ### Tinted Neutrals
143
+
144
+ When using custom colors via inline styles, avoid pure gray. Add a tiny tint toward the brand hue for subconscious cohesion:
145
+ - Pure gray feels lifeless next to brand color
146
+ - Tint neutrals very slightly toward the brand hue (e.g., a blue-brand app gets slightly blue-tinted grays)
147
+ - The tint should be imperceptible consciously but create warmth
148
+
149
+ ### Dark Mode Considerations
150
+
151
+ When building blocks with dark backgrounds:
152
+ - Depth comes from **surface lightness**, not shadow. Higher elevations = slightly lighter surfaces.
153
+ - Reduce body text font weight slightly (light text on dark reads heavier).
154
+ - Reduce chroma in colors at extreme lightness to avoid garish tones.
155
+ - Test all status colors on dark backgrounds — gray text washes out on color.
156
+
157
+ ### Color Rules:
158
+ - **Reserve `bg-primary` for the single most important action per screen.**
159
+ - **Use `text-muted-foreground`** for secondary labels, placeholders, helper text, timestamps.
160
+ - **Never communicate information by color alone.** Always pair with an icon, label, or shape.
161
+ - **Status badges**: distinct background + matching text — success (green), warning (amber), error (destructive), info (blue).
162
+
163
+ ### Absolute Color Bans (AI Slop Tells)
164
+ - **DO NOT** use cyan-on-dark, purple-to-blue gradients, or neon accents on dark backgrounds.
165
+ - **DO NOT** use pure black (`#000`) or pure white (`#fff`) for large areas.
166
+ - **DO NOT** use dark backgrounds with colored `box-shadow` glows.
167
+ - **DO NOT** use gradient text (`background-clip: text` with a gradient).
168
+ - **DO NOT** use gray text on any colored background — use a darker shade of the background hue instead.
169
+
170
+ ---
171
+
172
+ ## 6. Typography
173
+
174
+ ### Type Scale:
175
+
176
+ | Role | Tailwind class | Min size | Use |
177
+ |---|---|---|---|
178
+ | Page/block title | `text-2xl` | 22-24px | Single H1 per screen |
179
+ | Section headings | `text-lg` / `text-xl` | 18-20px | Major sections |
180
+ | Body / default | `text-base` | 16px | Primary readable content |
181
+ | Secondary / helper | `text-sm` | 14px | Labels, descriptions |
182
+ | Captions / badges | `text-xs` | 12px | Badges, footnotes only |
183
+
184
+ Aim for at least **1.25x ratio** between adjacent scale steps. Sizes only 1-2px apart create muddy hierarchy.
185
+
186
+ ### Rules:
187
+ - **Never go below 14px** for readable content (12px only for badges, footnotes).
188
+ - **Line height:** `leading-relaxed` (1.625) for body paragraphs. `leading-snug` for headings.
189
+ - **Max line length:** 60-75 characters. Use `max-w-prose` or `max-w-xl`.
190
+ - **Left-align body text.** Centered text is harder to scan for multi-line content.
191
+ - Use `font-medium` or `font-semibold` for label emphasis. Do not bold everything.
192
+ - Use `text-foreground`, not pure black. The theme token is calibrated for comfortable contrast.
193
+ - **Use tabular numbers** in data tables for column alignment: add `style={{ fontVariantNumeric: "tabular-nums" }}` to numeric cells.
194
+
195
+ ### Typography Anti-Patterns:
196
+ - **DO NOT** use monospace typography as lazy shorthand for "technical/developer" vibes.
197
+ - **DO NOT** place large rounded icons above every heading — they rarely add value and look templated.
198
+ - **DO NOT** set long body passages in uppercase. Reserve all-caps for short labels.
199
+ - **DO NOT** use only one font family with no hierarchy contrast.
200
+
201
+ ---
202
+
203
+ ## 7. Spacing: The 4pt Scale
204
+
205
+ All spacing uses **multiples of 4px**. The critical step that pure 8pt systems miss is **12px** — you frequently need it between 8 and 16.
206
+
207
+ ### Standard values:
208
+
209
+ | Value | Use |
210
+ |---|---|
211
+ | `p-1` / `gap-1` (4px) | Micro-spacing (icon + badge) |
212
+ | `p-2` / `gap-2` (8px) | Tight internal padding (icon buttons, badges) |
213
+ | `p-3` (12px) | Compact form field padding |
214
+ | `p-4` / `gap-4` (16px) | Standard card padding, button padding |
215
+ | `p-6` / `gap-6` (24px) | Section padding, card body |
216
+ | `p-8` (32px) | Large section gaps |
217
+ | `p-12` (48px) | Major page section separators |
218
+
219
+ ### Rules:
220
+ - **Vary spacing for hierarchy.** A heading with extra space above reads as more important. Uniform padding everywhere feels monotonous.
221
+ - **Internal spacing <= external spacing:** Padding *inside* a component must be smaller than the margin *between* components.
222
+ - **Button height:** 40px (`h-10`) or 48px (`h-12`) — touch-friendly.
223
+ - **Never use arbitrary values** like `p-[13px]`. Always use the Tailwind scale.
224
+ - **Generous whitespace** reduces cognitive load — it is not wasted space.
225
+
226
+ ### Depth and Elevation:
227
+ - Use semantic z-index levels: dropdown (100) > sticky (200) > modal-backdrop (300) > modal (400) > toast (500) > tooltip (600).
228
+ - Shadows should be subtle. If you can clearly see it, it is probably too strong.
229
+
230
+ ---
231
+
232
+ ## 8. Cards: Use with Restraint
233
+
234
+ Cards are powerful containers but easily overused. Wrapping everything in cards ("cardocalypse") flattens hierarchy.
235
+
236
+ ### When to use cards:
237
+ - Content is truly distinct and actionable
238
+ - Items need visual comparison in a grid
239
+ - Content needs clear interaction boundaries (clickable surfaces)
240
+
241
+ ### When NOT to use cards:
242
+ - Spacing and alignment already create sufficient grouping
243
+ - Content is inside another card (never nest cards inside cards)
244
+ - Identical card grids repeated endlessly (icon + heading + text) — this is a recognizable AI template
245
+
246
+ ### Card anatomy:
247
+ 1. **Header:** `CardTitle` + optional `CardDescription` + optional right-aligned action
248
+ 2. **Body:** Primary content with clear visual hierarchy
249
+ 3. **Footer (optional):** Secondary actions or metadata
250
+
251
+ ---
252
+
253
+ ## 9. Motion Design
254
+
255
+ ### The 100/300/500 Rule
256
+
257
+ Timing matters more than easing:
258
+
259
+ | Duration | Use Case |
260
+ |---|---|
261
+ | **100-150ms** | Instant feedback: button press, toggle, color change |
262
+ | **200-300ms** | State changes: menu open, tooltip, hover states |
263
+ | **300-500ms** | Layout changes: accordion, modal, drawer |
264
+ | **500-800ms** | Entrance animations: page load, hero reveals |
265
+
266
+ Exit animations should be ~75% of enter duration.
267
+
268
+ ### Easing
269
+
270
+ **Do not use the generic `ease` curve.** Use purpose-specific curves:
271
+
272
+ | Curve | Use For | CSS |
273
+ |---|---|---|
274
+ | **ease-out** | Elements entering view | `cubic-bezier(0.16, 1, 0.3, 1)` |
275
+ | **ease-in** | Elements leaving view | `cubic-bezier(0.7, 0, 0.84, 0)` |
276
+ | **ease-in-out** | State toggles (expand/collapse) | `cubic-bezier(0.65, 0, 0.35, 1)` |
277
+
278
+ Default recommendation: **ease-out-expo** — snappy, confident, feels natural.
279
+
280
+ ### What to Animate
281
+
282
+ **Only animate `transform` and `opacity`** — everything else causes layout recalculation and dropped frames. For height animations (accordions), use `grid-template-rows: 0fr -> 1fr` instead of animating `height` directly.
283
+
284
+ ### Staggered List Animations
285
+
286
+ Cap total stagger time — 10 items x 50ms = 500ms total. For many items, reduce per-item delay or cap the staggered count.
287
+
288
+ ### Reduced Motion (Required)
289
+
290
+ Vestibular disorders affect ~35% of adults over 40. Always respect `prefers-reduced-motion`:
291
+ - Replace motion with crossfade or instant transitions
292
+ - Never remove feedback entirely — just the movement
293
+
294
+ ### Motion Anti-Patterns:
295
+ - **DO NOT** use bounce or elastic easing. They feel amateurish and dated.
296
+ - **DO NOT** animate layout properties (width, height, padding, margin) — use transform.
297
+ - **DO NOT** use > 500ms for standard UI feedback.
298
+ - **DO NOT** add `will-change` to everything preemptively.
299
+
300
+ ---
301
+
302
+ ## 10. Buttons and Interactive Controls
303
+
304
+ ### Button states (all required):
305
+
306
+ | State | Purpose | Implementation |
307
+ |---|---|---|
308
+ | **Default** | Ready to use | Standard `Button` component |
309
+ | **Hover** | Cursor over it | Handled by shadcn `Button` |
310
+ | **Focus** | Keyboard-selected | `focus-visible:ring-2` — never remove |
311
+ | **Active** | Being pressed | Pressed in, darker |
312
+ | **Loading** | Action in progress | Replace label with `<Spinner />` + disable |
313
+ | **Disabled** | Not available | `disabled` prop — `opacity-50` |
314
+ | **Success** | Completed | Brief `Check` icon swap, 1-2 seconds |
315
+ | **Destructive** | Dangerous action | `variant="destructive"` — always with confirmation |
316
+
317
+ ### Button Label Formula:
318
+
319
+ | Bad | Good | Why |
320
+ |---|---|---|
321
+ | OK | Save changes | Says what will happen |
322
+ | Submit | Create account | Outcome-focused |
323
+ | Yes | Delete message | Confirms the action |
324
+ | Cancel | Keep editing | Clarifies what "cancel" means |
325
+ | Click here | Download PDF | Describes the destination |
326
+
327
+ ### Rules:
328
+ - **Primary action = one per screen.** Use `variant="default"` only for the primary CTA.
329
+ - **Touch target minimum:** 44x44px. Use `min-h-[44px] min-w-[44px]` for icon-only buttons.
330
+ - **Icon-only buttons must have `aria-label`.**
331
+ - **Never disable without explaining why.** Show tooltip or helper text.
332
+ - **Destructive buttons** must: use `variant="destructive"`, be positioned away from primary actions, trigger confirmation for irreversible actions.
333
+ - **DO NOT make every button primary.** Use ghost, outline, and secondary styles for hierarchy.
334
+
335
+ ---
336
+
337
+ ## 11. Forms and Input Fields
338
+
339
+ ### Label placement:
340
+ - **Always place labels above input fields**, never inside (placeholder only).
341
+ - Use `<label>` with `htmlFor` matching the input `id`.
342
+ - **Placeholder text** should be an example value, not a repeated label: "you@company.com" not "Enter email".
343
+
344
+ ### Validation:
345
+ - **Validate on blur**, not on every keystroke.
346
+ - **Error messages:** Always inline, directly below the field. Write as instruction: "Enter a valid email address" not "Invalid email."
347
+ - **Success states:** Show green check icon on validated fields.
348
+ - **Required fields:** Mark explicitly.
349
+
350
+ ### Error Message Formula:
351
+
352
+ | Situation | Template |
353
+ |---|---|
354
+ | Format error | "[Field] needs to be [format]. Example: [example]" |
355
+ | Missing required | "Please enter [what's missing]" |
356
+ | Permission denied | "You don't have access to [thing]. [What to do instead]" |
357
+ | Network error | "We couldn't reach [thing]. Check your connection and [action]." |
358
+ | Server error | "Something went wrong on our end. [Alternative action]" |
359
+
360
+ **Never blame the user.** "Please enter a date in MM/DD/YYYY format" not "You entered an invalid date."
361
+
362
+ ### Layout:
363
+ - **Single-column forms** are easier to complete than multi-column.
364
+ - **Group related fields** under labeled sections.
365
+ - **Submit button** at the bottom, full-width or right-aligned, primary variant.
366
+
367
+ ---
368
+
369
+ ## 12. Loading States
370
+
371
+ | Duration | Recommended Pattern |
372
+ |---|---|
373
+ | < 300ms | No indicator needed (feels instant) |
374
+ | 300ms - 1s | `<Spinner />` component inline |
375
+ | 1s - 3s | Skeleton screen (preferred) |
376
+ | > 3s | Progress indicator + cancel option |
377
+
378
+ ### Skeleton screens:
379
+ - Use `<Skeleton />` from shadcn/ui matching the final layout shape.
380
+ - Pulsing animation is included by default.
381
+ - Replace content progressively as data arrives.
382
+
383
+ ### Perceived Performance:
384
+ - **Optimistic UI**: Update the interface immediately, handle failures gracefully. Use for low-stakes actions (likes, filters); avoid for payments or destructive operations.
385
+ - **Skeleton over spinner** for data loading — it previews content shape and feels faster.
386
+
387
+ ### Implementation:
388
+ - Check `status === 'pending'` and render skeleton.
389
+ - Check `status === 'error'` and render error state with retry.
390
+ - Never render an empty block.
391
+
392
+ ---
393
+
394
+ ## 13. Empty States
395
+
396
+ Empty states are a critical UX moment — not an afterthought. They are onboarding opportunities.
397
+
398
+ ### Required structure:
399
+ 1. **Icon or illustration** relevant to the content type
400
+ 2. **Clear heading**: "No records yet" or "No results found"
401
+ 3. **Explanation sentence**: "You haven't added any items yet."
402
+ 4. **Primary CTA**: `<Button>Add your first item</Button>`
403
+
404
+ ### Rules:
405
+ - Do not say "No data" — be specific and human. "You don't have any projects yet."
406
+ - If empty due to search/filter, offer to clear the filter.
407
+ - Center-align with generous `py-16` or `py-24` padding.
408
+
409
+ ---
410
+
411
+ ## 14. Feedback and Microinteractions
412
+
413
+ | Interaction type | Duration |
414
+ |---|---|
415
+ | Button hover color change | 150ms |
416
+ | Form validation message | Instant (< 100ms after blur) |
417
+ | Success toast fade in | 200ms |
418
+ | Modal open/close | 200-300ms |
419
+ | Skeleton to content | Progressive (no delay) |
420
+
421
+ ### Rules:
422
+ - **Mutations:** Always show `toast.success()` or `toast.error()`.
423
+ - **Call `refetch()` before showing success toast** so UI reflects new state.
424
+ - **Button loading states:** Disable and show spinner while pending.
425
+ - **Form submission:** Disable submit, show spinner inside button.
426
+
427
+ ---
428
+
429
+ ## 15. Error Prevention and Destructive Actions
430
+
431
+ ### Confirmation dialogs:
432
+ - **Use before any irreversible action.** Restate what will be deleted, warn it cannot be undone.
433
+ - **Cancel button should be default focused** — keyboard users should not accidentally confirm.
434
+ - For **reversible soft-deletes**, skip the modal. Show undo toast for 5-8 seconds.
435
+
436
+ ### Spacing:
437
+ - Never place Delete/Remove adjacent to Save/Confirm.
438
+ - Use `variant="destructive"` to visually distinguish.
439
+
440
+ ### Prevent data loss:
441
+ - Prompt "You have unsaved changes. Discard them?" when dismissing with unsaved edits.
442
+ - Never silently discard user input.
443
+
444
+ ---
445
+
446
+ ## 16. Progressive Disclosure
447
+
448
+ Show users what they need now, reveal more on demand.
449
+
450
+ ### When to apply:
451
+ - Form has 5+ fields (collapse advanced under an accordion)
452
+ - List items have secondary details (expand or open a side sheet)
453
+ - Dashboard has summary and drill-down views
454
+
455
+ ### Patterns:
456
+
457
+ | Pattern | Use case | Component |
458
+ |---|---|---|
459
+ | **Accordion** | FAQ, settings, advanced fields | `Accordion` |
460
+ | **Sheet** | Full record details, edit forms | `Sheet` |
461
+ | **Dialog** | Confirmation, focused input | `Dialog` |
462
+ | **Tooltip** | Brief explanation (one sentence max) | `Tooltip` |
463
+ | **Tabs** | Multiple views of same data | `Tabs` |
464
+
465
+ ### Rules:
466
+ - Primary actions and data always on screen.
467
+ - Always make it obvious more content exists (chevron, "Show more", count badge).
468
+ - **DO NOT** use modals as a reflex — consider if there is a better place for the interaction first.
469
+
470
+ ---
471
+
472
+ ## 17. Navigation and Orientation
473
+
474
+ Users always need to know: *Where am I? Where can I go? How do I get back?*
475
+
476
+ - **Highlight the active state** clearly (`bg-accent` or `text-primary` + left border).
477
+ - Page/section headings must match navigation labels exactly.
478
+ - **Breadcrumbs** for any block with 3+ levels of depth.
479
+ - Provide a **clear back action** for sub-views.
480
+ - Navigation in the same position across all views.
481
+
482
+ ---
483
+
484
+ ## 18. Data Tables and Lists
485
+
486
+ ### Column rules:
487
+ - **Left-align text. Right-align numbers.** This dramatically improves scanning.
488
+ - **Use tabular numbers** (`style={{ fontVariantNumeric: "tabular-nums" }}`) for all numeric columns.
489
+ - Limit to **5-7 visible columns** on desktop; fewer on mobile.
490
+ - **Column headers clickable** for sorting with arrow indicators.
491
+
492
+ ### Row design:
493
+ - **Alternating row colors** (`bg-muted/30` on odd rows) for dense tables.
494
+ - Row actions in last column — always visible or in a `DropdownMenu` via `MoreHorizontal` icon.
495
+ - **Action buttons** must use `variant="ghost"` or `variant="outline"`, not primary.
496
+
497
+ ### Mobile adaptation:
498
+ - Transform table rows into **stacked card layouts** on small screens.
499
+ - `hidden md:block` on the table, `block md:hidden` on mobile cards.
500
+ - Never require horizontal scrolling for important data.
501
+
502
+ ---
503
+
504
+ ## 19. KPI / Metric Cards and Dashboards
505
+
506
+ ### KPI cards:
507
+ - **Large, bold number** for the primary metric (`text-3xl font-bold`)
508
+ - **Clear label** below or above (`text-sm text-muted-foreground`)
509
+ - **Trend indicator** with icon + percentage
510
+
511
+ ### Dashboard rules:
512
+ - Place most important KPIs at the top.
513
+ - Limit visible metrics to **4-6 on primary view**. Use tabs for more.
514
+ - Every chart needs: title, axis labels, legend (if multi-series), hover tooltip.
515
+ - **Bar charts** for comparisons, **line charts** for trends, **pie/donut charts** sparingly.
516
+ - **Avoid 3D charts** — they distort values.
517
+
518
+ ### Dashboard Anti-Pattern:
519
+ Avoid the "hero metric layout template" — big number, small label, supporting stats, gradient accent strip. This is the most recognizable AI design template and should be avoided unless intentionally chosen.
520
+
521
+ ---
522
+
523
+ ## 20. Accessibility Baseline
524
+
525
+ ### Touch targets:
526
+ - All interactive elements: **44x44px** minimum tappable area.
527
+ - Space interactive elements at least **8px apart**.
528
+
529
+ ### Color contrast:
530
+ - Body text: **4.5:1** minimum (WCAG AA).
531
+ - Large text (18px+ bold or 24px+): **3:1** minimum.
532
+ - Use semantic tokens (`text-foreground` on `bg-background`) — pre-calibrated.
533
+ - **Never use light gray text that fails the 4.5:1 ratio.**
534
+
535
+ ### Keyboard and screen reader:
536
+ - All interactive elements reachable by keyboard (Tab, Enter, Space, Escape).
537
+ - `aria-label` on all icon-only buttons.
538
+ - Semantic HTML: `<button>` for actions, `<a>` for navigation, `<input>` for data.
539
+ - **Focus rings:** Never `outline: none` without replacement. Always keep `focus-visible:ring-2`. Focus ring must be 2-3px thick, high contrast, offset from the element.
540
+ - Tables: proper `<thead>`, `<tbody>`, `<th scope="col">`.
541
+
542
+ ---
543
+
544
+ ## 21. Mobile-First Responsive Design
545
+
546
+ ### Rules:
547
+ - **Start with `flex-col`**, stack to `md:flex-row` or grid layouts at larger screens.
548
+ - **No horizontal overflow.** Use `overflow-x-hidden` as safety net.
549
+ - **Touch targets: 44px minimum.**
550
+ - **Hover states are desktop-only.** Never depend on `:hover` for essential actions.
551
+ - Form fields: `w-full` on mobile.
552
+ - Navigation: collapse to hamburger or bottom nav on small screens.
553
+
554
+ ### Breakpoint strategy:
555
+ ```
556
+ Mobile first: default -> sm (640px) -> md (768px) -> lg (1024px) -> xl (1280px)
557
+ ```
558
+
559
+ ### Beyond screen size:
560
+ Consider pointer and hover capabilities, not just viewport width. A laptop with touchscreen and a tablet with keyboard both exist. Touch devices need larger targets and always-visible controls.
561
+
562
+ ---
563
+
564
+ ## 22. UX Writing (Microcopy)
565
+
566
+ ### Core rules:
567
+ - **Labels:** Noun phrases. "First Name", "Due Date"
568
+ - **Buttons:** Verb + noun. "Save Changes", "Delete Record"
569
+ - **Error messages:** Plain language + solution.
570
+ - **Tooltips:** One sentence max. Explain what, not what it is.
571
+ - **Empty states:** Speak directly. "You don't have any projects yet."
572
+ - **Confirmation dialogs:** State the consequences.
573
+ - **Placeholders:** Example values ("you@company.com"), not repeated labels.
574
+
575
+ ### Voice vs Tone:
576
+
577
+ | Moment | Tone |
578
+ |---|---|
579
+ | Success | Celebratory, brief: "Done! Your changes are live." |
580
+ | Error | Empathetic, helpful: "That didn't work. Here's what to try..." |
581
+ | Loading | Reassuring: "Saving your work..." |
582
+ | Destructive | Serious, clear: "Delete this project? This can't be undone." |
583
+
584
+ **Never use humor for errors.** Users are already frustrated.
585
+
586
+ ### Consistency Glossary
587
+
588
+ Pick one term and stick with it across the entire block:
589
+
590
+ | Inconsistent | Choose one |
591
+ |---|---|
592
+ | Delete / Remove / Trash | **Delete** |
593
+ | Settings / Preferences / Options | **Settings** |
594
+ | Sign in / Log in / Enter | **Sign in** |
595
+ | Create / Add / New | **Create** |
596
+
597
+ ### Writing for Translation:
598
+ German text is ~30% longer than English. Allocate space. Keep numbers separate ("New messages: 3" not "You have 3 new messages").
599
+
600
+ ---
601
+
602
+ ## 23. Conventions and Consistency
603
+
604
+ ### Universal conventions:
605
+
606
+ | Convention | Rule |
607
+ |---|---|
608
+ | Logo / app name | Top-left |
609
+ | Search | Top-center or top-right, magnifying glass icon |
610
+ | Settings | Top-right, gear icon |
611
+ | Red = danger | Errors and destructive actions only |
612
+ | Checkmark | Confirmation / success |
613
+ | X icon | Close / cancel / remove |
614
+ | Pencil | Edit |
615
+ | Trash | Delete |
616
+ | Plus | Add / create |
617
+ | Chevron right | Navigate deeper |
618
+ | Chevron down | Expand in-place / dropdown |
619
+
620
+ ### Internal consistency:
621
+ - Same component for same pattern throughout a block.
622
+ - Same action always triggers same result.
623
+ - Button labels consistent — don't say "Save" in one place and "Update" for the same action.
624
+ - Spacing consistent — if cards have `p-6`, all cards in that block have `p-6`.
625
+
626
+ ---
627
+
628
+ ## 24. Calculator and Utility Tool Polish
629
+
630
+ 1. **Clear section grouping:** Separate Inputs from Results using Cards, Separator, or background shift.
631
+ 2. **Results prominently displayed:** Primary output `text-3xl font-bold text-primary`.
632
+ 3. **Real-time calculation:** Update as user types. No "Calculate" button for simple calculations.
633
+ 4. **Input labels with units:** Show unit next to label or inside input suffix.
634
+ 5. **Formatted numbers:** Use `toLocaleString()` for all outputs.
635
+ 6. **Reset button:** `variant="ghost"` or `variant="outline"`.
636
+ 7. **Visual result card:** Wrap primary result in `Card` with subtle `bg-primary/5` accent.
637
+ 8. **Edge case handling:** Helpful messages for impossible inputs, not NaN or Infinity.
638
+
639
+ ---
640
+
641
+ ## 25. AI Slop Anti-Pattern Checklist
642
+
643
+ Actively check for and reject these fingerprints of generic AI-generated interfaces:
644
+
645
+ ### Typography:
646
+ - NOT using only one font family with no hierarchy contrast
647
+ - NOT using a flat type hierarchy where sizes are < 1.25x ratio apart
648
+ - NOT placing large rounded icons above every heading
649
+ - NOT using monospace as lazy shorthand for "technical"
650
+ - NOT setting long body passages in uppercase
651
+
652
+ ### Color:
653
+ - NOT using cyan-on-dark, purple-to-blue gradients, neon accents
654
+ - NOT using gray text on colored backgrounds
655
+ - NOT using pure black/white for large areas
656
+ - NOT using dark mode with glowing colored box-shadows
657
+ - NOT using gradient text (`background-clip: text`)
658
+
659
+ ### Layout:
660
+ - NOT wrapping everything in cards (cardocalypse)
661
+ - NOT nesting cards inside cards
662
+ - NOT using identical card grids repeated endlessly
663
+ - NOT using the hero metric template (big number, label, stats, gradient)
664
+ - NOT center-aligning everything — prefer left-aligned with asymmetric layouts
665
+ - NOT using the same spacing everywhere — vary for hierarchy
666
+
667
+ ### Motion:
668
+ - NOT using bounce or elastic easing
669
+ - NOT animating layout properties (width, height, padding)
670
+ - NOT ignoring `prefers-reduced-motion`
671
+ - NOT using > 500ms for standard UI feedback
672
+
673
+ ### Structure:
674
+ - NOT using colored left/right border stripes as decoration (use sparingly only for active/selected state indicators)
675
+ - NOT using glassmorphism everywhere (blur effects, glass cards, glow borders as decoration)
676
+ - NOT using sparklines as decoration that convey nothing
677
+ - NOT using modals by reflex
678
+ - NOT making every button primary
679
+
680
+ ---
681
+
682
+ ## 26. Finishing Touches
683
+
684
+ - **Smooth transitions:** `transition-all duration-200` on cards and rows
685
+ - **Hover states on rows/cards:** `hover:bg-muted/50` for interactivity indication
686
+ - **Auto-focus first field** when form opens (`autoFocus`)
687
+ - **Escape to cancel** any modal, dialog, or inline edit
688
+ - **Confirmation animation:** Brief `Check` icon in save button after success
689
+ - **Badge counts:** Show filtered item count ("3 active projects")
690
+ - **Relative timestamps:** "2 hours ago" via `date-fns/formatDistanceToNow`
691
+ - **Truncate long text** with `truncate` or `line-clamp-2`, full value in `Tooltip`
692
+ - **Sticky headers** for long tables
693
+
694
+ ---
695
+
696
+ ## Appendix A: Quick Reference
697
+
698
+ | Need | Use |
699
+ |---|---|
700
+ | Primary CTA | `Button variant="default"` — one per screen |
701
+ | Secondary action | `Button variant="outline"` |
702
+ | Danger / delete | `Button variant="destructive"` |
703
+ | Edit a field | Always-visible `Pencil` icon + inline `Input` |
704
+ | Complex edit form | `Sheet` (slides from side) |
705
+ | Confirmation | `Dialog` with Cancel focused by default |
706
+ | Brief helper text | `Tooltip` (one sentence max) |
707
+ | Status values | `Badge` with color + text (never color alone) |
708
+ | Long lists | `Accordion` for secondary details |
709
+ | Multiple data views | `Tabs` |
710
+ | Loading data | `Skeleton` matching content structure |
711
+ | Empty collection | Icon + heading + explanation + CTA |
712
+ | Error state | Icon + message + retry button |
713
+
714
+ ## Appendix B: Motion and Spacing Tokens
715
+
716
+ ```css
717
+ /* Timing (100/300/500 rule) */
718
+ --duration-instant: 100ms;
719
+ --duration-fast: 200ms;
720
+ --duration-normal: 300ms;
721
+ --duration-slow: 500ms;
722
+ --ease-out: cubic-bezier(0.16, 1, 0.3, 1); /* elements entering */
723
+ --ease-in: cubic-bezier(0.7, 0, 0.84, 0); /* elements leaving */
724
+ --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1); /* state toggles */
725
+
726
+ /* Z-index semantic scale */
727
+ --z-dropdown: 100;
728
+ --z-sticky: 200;
729
+ --z-modal-backdrop: 300;
730
+ --z-modal: 400;
731
+ --z-toast: 500;
732
+ --z-tooltip: 600;
733
+ ```
734
+
735
+ ## Appendix C: Design Brief Template
736
+
737
+ Before building any complex Vibe Coding block, produce a brief:
738
+
739
+ 1. **Feature Summary** (2-3 sentences): What, who, why.
740
+ 2. **Primary User Action**: The single most important thing.
741
+ 3. **Design Direction**: 3 brand voice words. The aesthetic approach.
742
+ 4. **Layout Strategy**: What gets emphasis, how information flows.
743
+ 5. **Key States**: Default, empty, loading, error, success, edge cases.
744
+ 6. **Interaction Model**: What happens on click, hover, scroll.
745
+ 7. **Content Requirements**: Labels, error messages, microcopy, realistic data ranges.
746
+ 8. **Anti-Goals**: What this should NOT look like.