pi-design-deck 0.2.0 → 0.3.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.
Files changed (29) hide show
  1. package/README.md +49 -11
  2. package/deck-schema.ts +30 -0
  3. package/deck-server.ts +64 -10
  4. package/export-html.ts +329 -0
  5. package/form/css/controls.css +51 -0
  6. package/form/deck.html +2 -0
  7. package/form/js/deck-core.js +46 -0
  8. package/form/js/deck-interact.js +30 -12
  9. package/form/js/deck-render.js +2 -0
  10. package/form/js/deck-session.js +25 -9
  11. package/generate-prompts.ts +8 -10
  12. package/index.ts +317 -41
  13. package/package.json +2 -1
  14. package/prompts/deck-discover.md +3 -1
  15. package/prompts/deck-plan.md +3 -1
  16. package/prompts/deck.md +3 -1
  17. package/skills/design-deck/SKILL.md +44 -8
  18. package/skills/design-deck/references/component-gallery/INDEX.md +88 -0
  19. package/skills/design-deck/references/component-gallery/LOOKUP.md +592 -0
  20. package/skills/design-deck/references/component-gallery/components/INDEX.md +106 -0
  21. package/skills/design-deck/references/component-gallery/components/actions.md +354 -0
  22. package/skills/design-deck/references/component-gallery/components/data-display.md +812 -0
  23. package/skills/design-deck/references/component-gallery/components/feedback.md +513 -0
  24. package/skills/design-deck/references/component-gallery/components/inputs.md +921 -0
  25. package/skills/design-deck/references/component-gallery/components/layout.md +167 -0
  26. package/skills/design-deck/references/component-gallery/components/navigation.md +350 -0
  27. package/skills/design-deck/references/component-gallery/components/overlays.md +208 -0
  28. package/skills/design-deck/references/component-gallery/components/utilities.md +29 -0
  29. package/skills/design-deck/references/component-gallery/components.md +1383 -0
@@ -0,0 +1,88 @@
1
+ # Component Gallery Reference
2
+
3
+ Production-grade UI component knowledge — 2,676 real-world examples from 60 components across 100+ design systems, plus best practices and layout patterns.
4
+
5
+ ## File Structure
6
+
7
+ | File | Purpose |
8
+ |------|---------|
9
+ | `components.md` | Best practices, common layouts, and aliases for all 60 components |
10
+ | `LOOKUP.md` | Vocabulary resolution — maps user terms to canonical component names |
11
+ | `components/INDEX.md` | Browsable index of all design system implementations |
12
+ | `components/{category}.md` | Design system examples with URLs and preview images |
13
+
14
+ ## When to Read What
15
+
16
+ | Situation | Read |
17
+ |-----------|------|
18
+ | Building deck options for a UI component | `components.md` for best practices |
19
+ | User's term is ambiguous ("dropdown", "popup") | `LOOKUP.md` to resolve vocabulary |
20
+ | Need concrete visual references from real design systems | `components/{category}.md` |
21
+ | Want to see how Blueprint/Ant/Carbon implements X | `components/{category}.md` for URLs |
22
+
23
+ ## Categories
24
+
25
+ - **[Actions](components/actions.md)** (294 examples) — Button, Button group, Dropdown menu, Link, Segmented control
26
+ - **[Navigation](components/navigation.md)** (281 examples) — Breadcrumbs, Navigation, Pagination, Skip link, Stepper, Tabs
27
+ - **[Inputs](components/inputs.md)** (726 examples) — Checkbox, Combobox, Datepicker, Select, Slider, Text input, Toggle, etc.
28
+ - **[Data Display](components/data-display.md)** (663 examples) — Accordion, Avatar, Badge, Card, Table, Tree view, etc.
29
+ - **[Feedback](components/feedback.md)** (420 examples) — Alert, Progress bar, Skeleton, Spinner, Toast, Tooltip
30
+ - **[Overlays](components/overlays.md)** (170 examples) — Drawer, Modal, Popover
31
+ - **[Layout](components/layout.md)** (111 examples) — Footer, Header, Hero, Separator, Stack
32
+ - **[Utilities](components/utilities.md)** (11 examples) — Visually hidden
33
+
34
+ ## Design System Visual Languages
35
+
36
+ Use this table as vocabulary for generating distinct options:
37
+
38
+ | Design System | Visual Language | Good For |
39
+ |---------------|-----------------|----------|
40
+ | **98.css** | Windows 95 retro, beveled borders, system fonts | Nostalgic, developer tools |
41
+ | **Ant Design** | Clean lines, blue primary, minimal chrome | Modern web apps, dashboards |
42
+ | **Blueprint** | Dense, utilitarian, dark-mode native, monospace | Developer tools, data-dense UIs |
43
+ | **Carbon** | IBM enterprise, subtle depth, structured grid | Enterprise apps, B2B |
44
+ | **Material** | Elevation shadows, ripple effects, bold color | Consumer apps, mobile-first |
45
+ | **Chakra** | Composable, accessible defaults, clean aesthetic | React apps, rapid prototyping |
46
+ | **Radix** | Unstyled primitives, accessibility-first | Custom design systems |
47
+ | **shadcn/ui** | Tailwind-based, copy-paste components | Next.js apps, modern stacks |
48
+ | **Spectrum** | Adobe polish, refined interactions | Creative tools |
49
+ | **Shoelace** | Web components, themeable | Framework-agnostic projects |
50
+
51
+ ## When to Use Distinct Systems vs Variations
52
+
53
+ | Context | Approach |
54
+ |---------|----------|
55
+ | Exploring the design space | **Distinct systems** — Blueprint vs Ant vs 98.css |
56
+ | Project has established aesthetic | **Variations within that system** |
57
+ | User specifies a style | **Variations of that style** |
58
+ | Early exploration, no constraints | **Distinct systems** — maximize range |
59
+
60
+ ## Using the Design System Examples
61
+
62
+ Each entry in `components/{category}.md` includes:
63
+
64
+ ```
65
+ - [ComponentName](url) — DesignSystem · Tech · Features · [preview](imageUrl)
66
+ ```
67
+
68
+ **Example from inputs.md:**
69
+ ```
70
+ - [Checkbox](https://ant.design/components/checkbox) — Ant Design · React — Code examples, Open source · [preview](https://component.gallery/_astro/...)
71
+ ```
72
+
73
+ Use the URLs to:
74
+ - Reference actual documentation when generating options
75
+ - View preview images for visual inspiration
76
+ - Note the tech stack (React, Vue, Web Components) for context
77
+
78
+ ## Workflow
79
+
80
+ 1. **Resolve vocabulary** — Check `LOOKUP.md` if the user's term is ambiguous
81
+ 2. **Read best practices** — `components.md` for the component's patterns and layouts
82
+ 3. **Browse implementations** — `components/{category}.md` for real examples
83
+ 4. **Generate distinct options** — Apply different design system vocabularies
84
+
85
+ ## Attribution
86
+
87
+ - Component knowledge from [ui-design-brain](https://github.com/carmahhawwari/ui-design-brain) by [@Carmahhawwari](https://x.com/Carmahhawwari)
88
+ - Design system examples from [component.gallery](https://component.gallery) by [Iain Bean](https://iainbean.com)
@@ -0,0 +1,592 @@
1
+ # Component Lookup
2
+
3
+ Resolve user vocabulary to canonical component names.
4
+
5
+ ## How to Use
6
+
7
+ 1. **User names a component** → Check the Alias Index for direct mapping
8
+ 2. **Term is marked ⚠️** → Read the Disambiguation section for that term
9
+ 3. **User describes intent** ("I need something that...") → Use the Intent Clusters
10
+ 4. **Still unclear** → Ask a clarifying question before generating options
11
+
12
+ ---
13
+
14
+ ## Alias Index
15
+
16
+ One line per term. Format: `term → Component` or `term → ⚠️ [ambiguous options]`
17
+
18
+ ```
19
+ accordion → Accordion
20
+ action bar → Button group
21
+ action menu → Dropdown menu
22
+ activity indicator → Spinner
23
+ alert → Alert
24
+ anchor → Link
25
+ app bar → Header
26
+ autocomplete → Combobox
27
+ avatar → Avatar
28
+
29
+ badge → Badge
30
+ banner → Alert
31
+ blank slate → Empty state
32
+ box → Card
33
+ breadcrumb → Breadcrumbs
34
+ breadcrumbs → Breadcrumbs
35
+ bubble → Popover
36
+ btn → Button
37
+ button → Button
38
+ button bar → Button group
39
+ button group → Button group
40
+ button toggle → Segmented control
41
+
42
+ calendar → Datepicker
43
+ callout → Alert
44
+ card → Card
45
+ carousel → Carousel
46
+ check box → Checkbox
47
+ checkbox → Checkbox
48
+ checkmark → Checkbox
49
+ chip → ⚠️ [Badge, Combobox (multi-select)]
50
+ chips → ⚠️ [Badge, Combobox (multi-select)]
51
+ collapse → Accordion
52
+ collapsible → Accordion
53
+ combo box → Combobox
54
+ combobox → Combobox
55
+ completion bar → Progress bar
56
+ container → Card
57
+ context menu → Dropdown menu
58
+ crumbs → Breadcrumbs
59
+
60
+ date input → Datepicker
61
+ date picker → Datepicker
62
+ date selector → Datepicker
63
+ datepicker → Datepicker
64
+ dialog → Modal
65
+ disclosure → Accordion
66
+ divider → Separator
67
+ dot → Badge
68
+ drawer → Drawer
69
+ dropdown → ⚠️ [Select, Combobox, Dropdown menu]
70
+ dropdown menu → Dropdown menu
71
+ dropzone → File upload
72
+
73
+ empty state → Empty state
74
+ error message → Alert
75
+ expand → Accordion
76
+ expandable → Accordion
77
+ expander → Accordion
78
+
79
+ file input → File upload
80
+ file picker → File upload
81
+ file selector → File upload
82
+ file upload → File upload
83
+ filterable select → Combobox
84
+ floating panel → Popover
85
+ fold → Accordion
86
+ foldable → Accordion
87
+ footer → Footer
88
+
89
+ gallery → Carousel
90
+ grouped buttons → Button group
91
+
92
+ header → Header
93
+ hero → Hero
94
+ hero banner → Hero
95
+ horizontal rule → Separator
96
+ hover card → Popover
97
+ hr → Separator
98
+ hyperlink → Link
99
+
100
+ image slider → Carousel
101
+ info box → Alert
102
+ info bubble → Popover
103
+ initials → Avatar
104
+ inline message → Alert
105
+ input → ⚠️ [Text input, or any form control]
106
+
107
+ jumbotron → Hero
108
+
109
+ label → ⚠️ [Badge, or form label (not a component)]
110
+ left nav → Navigation
111
+ lightbox → Modal
112
+ line → Separator
113
+ link → Link
114
+ list → ⚠️ [List, Table, Cards]
115
+ list view → List
116
+ listing → List
117
+ listbox → Select
118
+ loader → ⚠️ [Spinner, Progress bar, Skeleton]
119
+ loading → ⚠️ [Spinner, Progress bar, Skeleton]
120
+ loading bar → Progress bar
121
+ loading indicator → Spinner
122
+ loading placeholder → Skeleton
123
+ loading spinner → Spinner
124
+
125
+ main nav → Navigation
126
+ masthead → Header
127
+ menu → ⚠️ [Navigation, Dropdown menu]
128
+ message → Alert
129
+ modal → Modal
130
+ modal dialog → Modal
131
+ more menu → Dropdown menu
132
+ multi-select → Select (multi) or Combobox (multi)
133
+ multi-step → Stepper
134
+
135
+ nav → Navigation
136
+ navbar → Header
137
+ navigation → Navigation
138
+ navigation bar → Header
139
+ navigation path → Breadcrumbs
140
+ no data → Empty state
141
+ no results → Empty state
142
+ notice → Alert
143
+ notification → ⚠️ [Alert, Toast]
144
+ notification badge → Badge
145
+
146
+ off-canvas → Drawer
147
+ omnibar → Search input
148
+ option button → Radio button
149
+ option buttons → Segmented control
150
+ options menu → Dropdown menu
151
+ overlay → ⚠️ [Modal, Drawer, Popover]
152
+ overflow menu → Dropdown menu
153
+
154
+ page footer → Footer
155
+ page navigation → Pagination
156
+ page numbers → Pagination
157
+ pager → Pagination
158
+ pagination → Pagination
159
+ panel → ⚠️ [Card, Drawer, Popover]
160
+ path → Breadcrumbs
161
+ percentage bar → Progress bar
162
+ picker → ⚠️ [Select, Combobox, Datepicker]
163
+ pill → Badge
164
+ pill toggle → Segmented control
165
+ placeholder → Skeleton
166
+ placeholder state → Empty state
167
+ pop-up → ⚠️ [Modal, Popover, Tooltip]
168
+ popover → Popover
169
+ popup → ⚠️ [Modal, Popover, Tooltip]
170
+ popup menu → Dropdown menu
171
+ primary navigation → Navigation
172
+ profile image → Avatar
173
+ profile photo → Avatar
174
+ profile picture → Avatar
175
+ progress → Progress bar
176
+ progress bar → Progress bar
177
+ progress indicator → Progress indicator
178
+ progress steps → Stepper
179
+
180
+ radio → Radio button
181
+ radio button → Radio button
182
+ radio group → Radio button
183
+ range input → Slider
184
+ range slider → Slider
185
+ rating → Rating
186
+ review stars → Rating
187
+ rotator → Carousel
188
+
189
+ score → Rating
190
+ scrubber → Slider
191
+ search → Search input
192
+ search bar → Search input
193
+ search box → Search input
194
+ search field → Search input
195
+ search input → Search input
196
+ search select → Combobox
197
+ searchable dropdown → Combobox
198
+ segment → Segmented control
199
+ segmented control → Segmented control
200
+ select → Select
201
+ select box → Select
202
+ select input → Select
203
+ separator → Separator
204
+ sheet → Drawer
205
+ showyhideything → Accordion
206
+ shimmer → Skeleton
207
+ side nav → Navigation
208
+ side navigation → Navigation
209
+ side panel → Drawer
210
+ sidebar → ⚠️ [Navigation, Drawer]
211
+ single select → Radio button
212
+ site footer → Footer
213
+ site header → Header
214
+ site nav → Navigation
215
+ skeleton → Skeleton
216
+ skeleton loader → Skeleton
217
+ slide-over → Drawer
218
+ slider → Slider
219
+ slideshow → Carousel
220
+ snackbar → Toast
221
+ spinner → Spinner
222
+ splash → Hero
223
+ star rating → Rating
224
+ stars → Rating
225
+ status indicator → Badge
226
+ stepper → Stepper
227
+ steps → Stepper
228
+ submit button → Button
229
+ switch → Toggle
230
+ switcher → Segmented control
231
+ swiper → Carousel
232
+
233
+ tab → Tabs
234
+ table → Table
235
+ tabs → Tabs
236
+ tag → ⚠️ [Badge, Combobox (multi-select)]
237
+ tag input → Combobox (multi-select with visible tags)
238
+ tags → ⚠️ [Badge, Combobox (multi-select)]
239
+ text area → Textarea
240
+ text field → Text input
241
+ text input → Text input
242
+ text link → Link
243
+ textarea → Textarea
244
+ throbber → Spinner
245
+ tick box → Checkbox
246
+ tile → Card
247
+ timeline → ⚠️ [Progress indicator, Stepper]
248
+ toast → Toast
249
+ toggle → Toggle
250
+ toggle group → Segmented control
251
+ toolbar → Button group
252
+ toolbar buttons → Button group
253
+ tooltip → Tooltip
254
+ top bar → Header
255
+ track → Slider
256
+ trail → Breadcrumbs
257
+ tree → Tree view
258
+ tree view → Tree view
259
+ typeahead → Combobox
260
+
261
+ upload → File upload
262
+ user icon → Avatar
263
+ user image → Avatar
264
+
265
+ warning → Alert
266
+ wizard → Stepper
267
+ workflow → Stepper
268
+
269
+ zero state → Empty state
270
+ ```
271
+
272
+ ---
273
+
274
+ ## Disambiguation
275
+
276
+ When a term is marked ⚠️ above, use these rules to resolve it.
277
+
278
+ ### dropdown
279
+
280
+ | User's Context | Component |
281
+ |----------------|-----------|
282
+ | "dropdown in a form" / "select a value" | **Select** |
283
+ | "dropdown with search" / "type to filter" | **Combobox** |
284
+ | "dropdown menu" / "actions" / "click to show options" | **Dropdown menu** |
285
+
286
+ **Clarifying question:** "Is this for selecting a form value, or for showing actions/navigation?"
287
+
288
+ ### popup / overlay / pop-up
289
+
290
+ | User's Context | Component |
291
+ |----------------|-----------|
292
+ | "blocks the page" / "confirmation" / "important" | **Modal** |
293
+ | "appears near the button" / "details on click" | **Popover** |
294
+ | "slides in from the side" / "panel" | **Drawer** |
295
+ | "hint on hover" / "small label" | **Tooltip** |
296
+
297
+ **Clarifying question:** "Should it block interaction with the page, or appear near a trigger element?"
298
+
299
+ ### loading / loader
300
+
301
+ | User's Context | Component |
302
+ |----------------|-----------|
303
+ | "don't know how long" / "indeterminate" | **Spinner** |
304
+ | "shows percentage" / "progress" / "determinate" | **Progress bar** |
305
+ | "shows layout while loading" / "placeholder" | **Skeleton** |
306
+
307
+ **Clarifying question:** "Is the wait duration known (progress bar) or unknown (spinner)? Or do you want a layout preview (skeleton)?"
308
+
309
+ ### notification
310
+
311
+ | User's Context | Component |
312
+ |----------------|-----------|
313
+ | "inline" / "stays on page" / "persistent" | **Alert** |
314
+ | "pops up briefly" / "auto-dismiss" / "temporary" | **Toast** |
315
+
316
+ **Clarifying question:** "Should it stay visible until dismissed, or disappear automatically?"
317
+
318
+ ### dialog
319
+
320
+ | User's Context | Component |
321
+ |----------------|-----------|
322
+ | "shows content" / "form" / "information" | **Modal** |
323
+ | "requires decision" / "confirm/cancel" / "destructive action" | **Modal** (alert dialog pattern) |
324
+
325
+ Usually both map to Modal. The distinction is in the content and dismissal behavior, not the component.
326
+
327
+ ### menu
328
+
329
+ | User's Context | Component |
330
+ |----------------|-----------|
331
+ | "site navigation" / "main menu" / "pages" | **Navigation** |
332
+ | "actions on click" / "context menu" / "more options" | **Dropdown menu** |
333
+
334
+ **Clarifying question:** "Is this for site/app navigation, or for contextual actions?"
335
+
336
+ ### sidebar
337
+
338
+ | User's Context | Component |
339
+ |----------------|-----------|
340
+ | "always visible" / "navigation links" / "left nav" | **Navigation** (vertical layout) |
341
+ | "slides in" / "temporary" / "overlay" | **Drawer** |
342
+
343
+ **Clarifying question:** "Is it always visible, or does it slide in when triggered?"
344
+
345
+ ### list
346
+
347
+ | User's Context | Component |
348
+ |----------------|-----------|
349
+ | "display items" / "show data" | **List** |
350
+ | "rows and columns" / "sortable" / "structured data" | **Table** |
351
+ | "visual items" / "thumbnails" / "grid" | **Cards** |
352
+ | "select from options" | **Select** or **Radio button** |
353
+
354
+ **Clarifying question:** "Is this for displaying data, or for user selection?"
355
+
356
+ ### panel
357
+
358
+ | User's Context | Component |
359
+ |----------------|-----------|
360
+ | "content container" / "section" / "box" | **Card** |
361
+ | "slides from side" / "temporary" | **Drawer** |
362
+ | "appears near trigger" / "floating" | **Popover** |
363
+
364
+ **Clarifying question:** "Is this a static content container, or does it appear/disappear?"
365
+
366
+ ### chip / chips / tag / tags
367
+
368
+ | User's Context | Component |
369
+ |----------------|-----------|
370
+ | "status label" / "category" / "read-only" | **Badge** |
371
+ | "user can add/remove" / "multi-select" / "input" | **Combobox** (multi-select) |
372
+
373
+ **Clarifying question:** "Are these labels for display, or can users add/remove them?"
374
+
375
+ ### picker
376
+
377
+ | User's Context | Component |
378
+ |----------------|-----------|
379
+ | "select from list" | **Select** or **Combobox** |
380
+ | "choose a date" | **Datepicker** |
381
+ | "choose a file" | **File upload** |
382
+ | "choose a color" | **Color picker** (specialized) |
383
+
384
+ **Clarifying question:** "What type of value is being picked — a list option, date, file, or color?"
385
+
386
+ ### label
387
+
388
+ | User's Context | Component |
389
+ |----------------|-----------|
390
+ | "status indicator" / "category" / "count" | **Badge** |
391
+ | "form field label" | Not a component — part of form field markup |
392
+
393
+ ### input
394
+
395
+ Almost always **Text input**, but clarify if the context suggests:
396
+ - Date → **Datepicker**
397
+ - File → **File upload**
398
+ - Search → **Search input** or **Combobox**
399
+ - Number with range → **Slider**
400
+ - Selection → **Select**, **Combobox**, or **Radio button**
401
+
402
+ ### timeline
403
+
404
+ | User's Context | Component |
405
+ |----------------|-----------|
406
+ | "progress through steps" / "wizard" / "multi-step" | **Stepper** or **Progress indicator** |
407
+ | "chronological events" / "activity feed" / "history" | **List** (styled with connectors) |
408
+
409
+ **Clarifying question:** "Is this showing progress through steps, or a chronological list of events?"
410
+
411
+ Note: A true "timeline" showing events isn't a standalone component in most systems — use a styled **List** with visual connectors.
412
+
413
+ ---
414
+
415
+ ## Intent Clusters
416
+
417
+ When users describe what they're trying to accomplish rather than naming a component.
418
+
419
+ ### "I need users to pick/choose/select..."
420
+
421
+ | Constraint | Component | Notes |
422
+ |------------|-----------|-------|
423
+ | Few options (2-5), all visible | **Radio button** | Vertical list, one selection |
424
+ | Few options, inline/compact | **Segmented control** | Horizontal, button-like |
425
+ | Many options (6+) | **Select** | Hidden until clicked |
426
+ | Many options, searchable | **Combobox** | Type to filter |
427
+ | Multiple selections, few items | **Checkbox** | List of checkboxes |
428
+ | Multiple selections, many items | **Combobox** (multi) or **Select** (multi) | Compact, removable tags |
429
+ | Binary on/off | **Toggle** | Immediate effect |
430
+ | Binary yes/no in a form | **Checkbox** | Submit with form |
431
+
432
+ **Key question:** How many options, and can they select multiple?
433
+
434
+ ### "I need to show/reveal/expand content..."
435
+
436
+ | Constraint | Component | Notes |
437
+ |------------|-----------|-------|
438
+ | Multiple collapsible sections | **Accordion** | Stack of expandable panels |
439
+ | Single expandable section | **Accordion** (1 item) | Or custom disclosure |
440
+ | Details near a trigger | **Popover** | Click to show, click away to dismiss |
441
+ | Hint text on hover | **Tooltip** | Brief, non-interactive |
442
+ | Important content, blocks page | **Modal** | Centered, with backdrop |
443
+ | Supplementary content, lots of space | **Drawer** | Slides from edge |
444
+ | Preview on hover | **Popover** or **Tooltip** | Depends on content size |
445
+
446
+ **Key question:** How important is it, and should it block the page?
447
+
448
+ ### "I need to show status/feedback..."
449
+
450
+ | Constraint | Component | Notes |
451
+ |------------|-----------|-------|
452
+ | Inline message, stays visible | **Alert** | Info, success, warning, error |
453
+ | Brief notification, auto-dismiss | **Toast** | Bottom or top corner |
454
+ | Action completed | **Toast** | "Saved successfully" |
455
+ | Error that needs attention | **Alert** | Inline near the problem |
456
+ | Loading, unknown duration | **Spinner** | Indeterminate |
457
+ | Loading, known progress | **Progress bar** | 0-100% |
458
+ | Loading, preserve layout | **Skeleton** | Gray shapes matching content |
459
+ | No content to show | **Empty state** | Illustration + message + action |
460
+
461
+ **Key question:** Transient or persistent? Blocking or informational?
462
+
463
+ ### "I need navigation..."
464
+
465
+ | Constraint | Component | Notes |
466
+ |------------|-----------|-------|
467
+ | Switch between views, same page | **Tabs** | Content below tabs |
468
+ | Site/app pages | **Navigation** or **Header** | Links to different pages |
469
+ | Show where user is | **Breadcrumbs** | Hierarchical path |
470
+ | Large result set | **Pagination** | Page numbers or prev/next |
471
+ | Deep hierarchy | **Tree view** | Expandable nodes |
472
+ | Secondary navigation | **Navigation** | Persistent left panel |
473
+ | Mobile navigation | **Drawer** | Hamburger menu → slide-in |
474
+ | Multi-step flow / wizard | **Stepper** or **Progress indicator** | Shows completed/current/upcoming steps |
475
+
476
+ **Key question:** Same page or different pages? How deep is the hierarchy?
477
+
478
+ ### "I need to display data..."
479
+
480
+ | Constraint | Component | Notes |
481
+ |------------|-----------|-------|
482
+ | Rows and columns, structured | **Table** | Sortable, filterable |
483
+ | Visual items, thumbnails | **Cards** | Grid or list layout |
484
+ | Simple list of items | **List** | Text-focused |
485
+ | User identity | **Avatar** | Image or initials |
486
+ | Status or count | **Badge** | Small, inline |
487
+ | Score or rating | **Rating** | Stars or similar |
488
+ | Sequence of events | **List** (vertical) | Style as timeline with connectors |
489
+
490
+ ### "I need form input for..."
491
+
492
+ | Constraint | Component | Notes |
493
+ |------------|-----------|-------|
494
+ | Short text | **Text input** | Single line |
495
+ | Long text | **Textarea** | Multi-line |
496
+ | Date | **Datepicker** | Calendar UI |
497
+ | Date range | **Datepicker** (range variant) | Two dates |
498
+ | File | **File upload** | Drag-drop or browse |
499
+ | Number in a range | **Slider** | Visual track |
500
+ | Search/filter | **Search input** or **Combobox** | With suggestions |
501
+
502
+ ---
503
+
504
+ ## Clarification Templates
505
+
506
+ When you need to ask before generating options:
507
+
508
+ ### Selection ambiguity
509
+ > "How many options will users choose from? And can they select multiple?"
510
+
511
+ ### Disclosure ambiguity
512
+ > "Should this overlay the page (modal) or appear near a trigger (popover)?"
513
+
514
+ ### Loading ambiguity
515
+ > "Is the loading duration known (progress bar) or unknown (spinner)?"
516
+
517
+ ### Notification ambiguity
518
+ > "Should the message stay until dismissed, or disappear automatically?"
519
+
520
+ ### Navigation ambiguity
521
+ > "Is this navigation within the same page (tabs) or to different pages?"
522
+
523
+ ### List ambiguity
524
+ > "Is this for displaying information, or for user selection?"
525
+
526
+ ---
527
+
528
+ ## Edge Cases
529
+
530
+ ### Hybrid components
531
+
532
+ Some user requests combine multiple components:
533
+
534
+ | User Says | Likely Combination |
535
+ |-----------|-------------------|
536
+ | "searchable dropdown" | **Combobox** (single component) |
537
+ | "multi-select with tags" | **Combobox** (multi) or **Select** (multi) |
538
+ | "modal with form" | **Modal** containing form components |
539
+ | "sidebar navigation" | **Navigation** (vertical) or **Tree view** |
540
+ | "loading button" | **Button** with **Spinner** inside |
541
+ | "card with actions" | **Card** with **Button group** or **Dropdown menu** |
542
+
543
+ ### Components that don't exist as standalone
544
+
545
+ | User Says | What They Need |
546
+ |-----------|----------------|
547
+ | "label" (form) | Part of form field markup, not a component |
548
+ | "icon" | Used within other components (Button, Avatar, etc.) |
549
+ | "grid" | Layout system, not a component |
550
+ | "container" | Usually **Card** or layout wrapper |
551
+ | "section" | Layout concept; maybe **Card** or **Separator** |
552
+ | "form" | Collection of form components |
553
+
554
+ ### Platform-specific terms
555
+
556
+ | Term | Web Equivalent |
557
+ |------|----------------|
558
+ | "action sheet" (iOS) | **Drawer** (bottom) or **Dropdown menu** |
559
+ | "snackbar" (Material) | **Toast** |
560
+ | "FAB" (Material) | **Button** (floating variant) |
561
+ | "bottom sheet" (mobile) | **Drawer** (bottom) |
562
+ | "navigation drawer" (Material) | **Drawer** with **Navigation** inside |
563
+ | "app bar" (Material) | **Header** |
564
+ | "chip" (Material) | **Badge** or **Combobox** (multi) tag |
565
+
566
+ ---
567
+
568
+ ## Quick Reference: Common Confusions
569
+
570
+ | Often Confused | Key Difference |
571
+ |----------------|----------------|
572
+ | Select vs Combobox | Combobox is searchable/filterable |
573
+ | Radio vs Segmented control | Radio is form-native; segmented is button-like, often toolbar |
574
+ | Modal vs Drawer | Modal is centered + blocks; Drawer slides from edge |
575
+ | Modal vs Popover | Modal blocks page; Popover is near trigger, doesn't block |
576
+ | Tooltip vs Popover | Tooltip is small hint text; Popover has richer content |
577
+ | Alert vs Toast | Alert is persistent/inline; Toast is temporary |
578
+ | Badge vs Tag | Badge is status/count; Tag often implies removable/input |
579
+ | Toggle vs Checkbox | Toggle has immediate effect; Checkbox submits with form |
580
+ | Tabs vs Segmented control | Tabs switch content panels; Segmented control is a value selector |
581
+ | Accordion vs Tabs | Accordion is vertical, multiple can open; Tabs is horizontal, one at a time |
582
+ | Spinner vs Progress bar | Spinner is indeterminate; Progress bar shows percentage |
583
+ | Skeleton vs Spinner | Skeleton previews layout; Spinner is generic loading |
584
+ | List vs Table | List is simple items; Table has columns and structure |
585
+ | Navigation vs Tabs | Navigation goes to pages; Tabs switch content in place |
586
+ | Navigation (side) vs Drawer | Side navigation is persistent; Drawer slides in temporarily |
587
+
588
+ ---
589
+
590
+ ## Attribution
591
+
592
+ Component knowledge sourced from [component.gallery](https://component.gallery) and [ui-design-brain](https://github.com/carmahhawwari/ui-design-brain).