pi-design-deck 0.2.0 → 0.3.1

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 (30) hide show
  1. package/README.md +51 -13
  2. package/deck-schema.ts +33 -3
  3. package/deck-server.ts +64 -10
  4. package/export-html.ts +329 -0
  5. package/form/css/controls.css +152 -16
  6. package/form/css/layout.css +7 -0
  7. package/form/deck.html +16 -0
  8. package/form/js/deck-core.js +118 -0
  9. package/form/js/deck-interact.js +30 -12
  10. package/form/js/deck-render.js +2 -0
  11. package/form/js/deck-session.js +31 -12
  12. package/generate-prompts.ts +8 -10
  13. package/index.ts +318 -42
  14. package/package.json +2 -1
  15. package/prompts/deck-discover.md +3 -1
  16. package/prompts/deck-plan.md +3 -1
  17. package/prompts/deck.md +3 -1
  18. package/skills/design-deck/SKILL.md +45 -9
  19. package/skills/design-deck/references/component-gallery/INDEX.md +88 -0
  20. package/skills/design-deck/references/component-gallery/LOOKUP.md +592 -0
  21. package/skills/design-deck/references/component-gallery/components/INDEX.md +106 -0
  22. package/skills/design-deck/references/component-gallery/components/actions.md +354 -0
  23. package/skills/design-deck/references/component-gallery/components/data-display.md +812 -0
  24. package/skills/design-deck/references/component-gallery/components/feedback.md +513 -0
  25. package/skills/design-deck/references/component-gallery/components/inputs.md +921 -0
  26. package/skills/design-deck/references/component-gallery/components/layout.md +167 -0
  27. package/skills/design-deck/references/component-gallery/components/navigation.md +350 -0
  28. package/skills/design-deck/references/component-gallery/components/overlays.md +208 -0
  29. package/skills/design-deck/references/component-gallery/components/utilities.md +29 -0
  30. package/skills/design-deck/references/component-gallery/components.md +1383 -0
@@ -0,0 +1,1383 @@
1
+ # UI Component Reference
2
+
3
+ Complete reference for 60 UI components with best practices, common layouts, and aliases.
4
+ Sourced from [component.gallery](https://component.gallery) and enriched with production-grade guidance.
5
+
6
+ ---
7
+
8
+ ## Contents
9
+
10
+
11
+ - [Accordion](#accordion)
12
+ - [Alert](#alert)
13
+ - [Avatar](#avatar)
14
+ - [Badge](#badge)
15
+ - [Breadcrumbs](#breadcrumbs)
16
+ - [Button](#button)
17
+ - [Button group](#button-group)
18
+ - [Card](#card)
19
+ - [Carousel](#carousel)
20
+ - [Checkbox](#checkbox)
21
+ - [Color picker](#color-picker)
22
+ - [Combobox](#combobox)
23
+ - [Date input](#date-input)
24
+ - [Datepicker](#datepicker)
25
+ - [Drawer](#drawer)
26
+ - [Dropdown menu](#dropdown-menu)
27
+ - [Empty state](#empty-state)
28
+ - [Fieldset](#fieldset)
29
+ - [File](#file)
30
+ - [File upload](#file-upload)
31
+ - [Footer](#footer)
32
+ - [Form](#form)
33
+ - [Header](#header)
34
+ - [Heading](#heading)
35
+ - [Hero](#hero)
36
+ - [Icon](#icon)
37
+ - [Image](#image)
38
+ - [Label](#label)
39
+ - [Link](#link)
40
+ - [List](#list)
41
+ - [Modal](#modal)
42
+ - [Navigation](#navigation)
43
+ - [Pagination](#pagination)
44
+ - [Popover](#popover)
45
+ - [Progress bar](#progress-bar)
46
+ - [Progress indicator](#progress-indicator)
47
+ - [Quote](#quote)
48
+ - [Radio button](#radio-button)
49
+ - [Rating](#rating)
50
+ - [Rich text editor](#rich-text-editor)
51
+ - [Search input](#search-input)
52
+ - [Segmented control](#segmented-control)
53
+ - [Select](#select)
54
+ - [Separator](#separator)
55
+ - [Skeleton](#skeleton)
56
+ - [Skip link](#skip-link)
57
+ - [Slider](#slider)
58
+ - [Spinner](#spinner)
59
+ - [Stack](#stack)
60
+ - [Stepper](#stepper)
61
+ - [Table](#table)
62
+ - [Tabs](#tabs)
63
+ - [Text input](#text-input)
64
+ - [Textarea](#textarea)
65
+ - [Toast](#toast)
66
+ - [Toggle](#toggle)
67
+ - [Tooltip](#tooltip)
68
+ - [Tree view](#tree-view)
69
+ - [Video](#video)
70
+ - [Visually hidden](#visually-hidden)
71
+
72
+ ---
73
+
74
+ ## Accordion
75
+
76
+ [Browse real examples →](https://component.gallery/components/accordion/)
77
+
78
+ **Also known as:** Arrow toggle · Collapse · Collapsible sections · Collapsible · Details · Disclosure · Expandable · Expander · ShowyHideyThing
79
+
80
+ A vertically stacked set of collapsible sections — each heading toggles between showing a short label and revealing the full content beneath it.
81
+
82
+ **Best practices:**
83
+ - Use for long-form content that benefits from progressive disclosure
84
+ - Keep headings concise and scannable — they are the primary navigation
85
+ - Allow multiple sections open simultaneously unless space is critically limited
86
+ - Include a subtle expand/collapse icon (chevron) aligned consistently on the right
87
+ - Animate open/close with a short ease-out transition (150–250 ms)
88
+ - Ensure keyboard navigation: Enter/Space toggles, arrow keys move between headers
89
+
90
+ **Common layouts:**
91
+ - FAQ page with stacked question/answer pairs
92
+ - Settings panel with grouped preference sections
93
+ - Sidebar filter groups in e-commerce or dashboards
94
+ - Mobile navigation with expandable menu sections
95
+
96
+ ---
97
+
98
+ ## Alert
99
+
100
+ [Browse real examples →](https://component.gallery/components/alert/)
101
+
102
+ **Also known as:** Notification · Feedback · Message · Banner · Callout
103
+
104
+ A prominent message used to communicate important information or status changes to the user.
105
+
106
+ **Best practices:**
107
+ - Use semantic color coding: red for errors, amber for warnings, green for success, blue for info
108
+ - Include a clear, actionable message — not just a status label
109
+ - Provide a dismiss action for non-critical alerts
110
+ - Position inline alerts close to the relevant content, not floating arbitrarily
111
+ - Use an icon alongside color to ensure accessibility for color-blind users
112
+ - Keep alert text to one or two sentences maximum
113
+
114
+ **Common layouts:**
115
+ - Top-of-page banner for system-wide announcements
116
+ - Inline form validation message beneath an input field
117
+ - Toast notification stack in the bottom-right corner
118
+ - Contextual warning inside a card or settings section
119
+
120
+ ---
121
+
122
+ ## Avatar
123
+
124
+ [Browse real examples →](https://component.gallery/components/avatar/)
125
+
126
+ A visual representation of a user, typically displayed as a photo, illustration, or initials.
127
+
128
+ **Best practices:**
129
+ - Support three sizes: small (24–32 px), medium (40–48 px), large (64–80 px)
130
+ - Fall back gracefully: image → initials → generic icon
131
+ - Use a subtle ring or border to separate the avatar from its background
132
+ - For groups, stack avatars with a slight overlap and a '+N' overflow indicator
133
+ - Ensure the image is loaded lazily with a placeholder shimmer
134
+
135
+ **Common layouts:**
136
+ - User profile header with name and role
137
+ - Comment thread with avatar beside each message
138
+ - Team member list with stacked avatar group
139
+ - Navigation bar user menu trigger
140
+
141
+ ---
142
+
143
+ ## Badge
144
+
145
+ [Browse real examples →](https://component.gallery/components/badge/)
146
+
147
+ **Also known as:** Tag · Label · Chip
148
+
149
+ A compact label that sits within or near a larger component to convey status, category, or other metadata.
150
+
151
+ **Best practices:**
152
+ - Keep badge text to one or two words — they are labels, not sentences
153
+ - Use a limited palette of badge colors mapped to clear semantics
154
+ - Ensure sufficient contrast between badge text and background (WCAG AA minimum)
155
+ - Use pill shape (fully rounded corners) for status badges, rounded rectangles for tags
156
+ - Avoid overusing badges — if everything is badged, nothing stands out
157
+
158
+ **Common layouts:**
159
+ - Status indicator on a table row (Active, Pending, Archived)
160
+ - Tag cloud beneath a blog post or product card
161
+ - Notification count on a nav icon
162
+ - Feature label on a pricing tier card
163
+
164
+ ---
165
+
166
+ ## Breadcrumbs
167
+
168
+ [Browse real examples →](https://component.gallery/components/breadcrumbs/)
169
+
170
+ **Also known as:** Breadcrumb trail
171
+
172
+ A trail of links that shows where the current page sits within the site's navigational hierarchy.
173
+
174
+ **Best practices:**
175
+ - Show the full hierarchy path; truncate middle segments on mobile with an ellipsis menu
176
+ - The current page should be the last item and should not be a link
177
+ - Use a subtle separator (/ or ›) with adequate spacing
178
+ - Place breadcrumbs near the top of the content area, below the header
179
+ - Keep breadcrumb text lowercase or sentence-case for readability
180
+
181
+ **Common layouts:**
182
+ - E-commerce category → subcategory → product page
183
+ - Documentation site section navigation
184
+ - Dashboard drill-down from overview to detail view
185
+ - File manager path display
186
+
187
+ ---
188
+
189
+ ## Button
190
+
191
+ [Browse real examples →](https://component.gallery/components/button/)
192
+
193
+ An interactive control that triggers an action — submitting a form, opening a dialog, toggling visibility.
194
+
195
+ **Best practices:**
196
+ - Establish a clear visual hierarchy: primary (filled), secondary (outlined), tertiary (text-only)
197
+ - Use verb-first labels: 'Save changes', 'Create project', not 'Okay' or 'Submit'
198
+ - Minimum touch target of 44×44 px; desktop buttons at least 36 px tall
199
+ - Show a loading spinner inside the button during async actions — disable to prevent double-clicks
200
+ - Limit to one primary button per visible viewport section
201
+ - Ensure focus ring is visible and high-contrast for keyboard users
202
+
203
+ **Common layouts:**
204
+ - Form footer with primary action right-aligned and secondary action left-aligned
205
+ - Hero CTA button centered or left-aligned beneath headline
206
+ - Dialog footer with Cancel (secondary) and Confirm (primary)
207
+ - Floating action button (FAB) in bottom-right for mobile creation flows
208
+
209
+ ---
210
+
211
+ ## Button group
212
+
213
+ [Browse real examples →](https://component.gallery/components/button-group/)
214
+
215
+ **Also known as:** Toolbar
216
+
217
+ A container that groups related buttons together as a single visual unit.
218
+
219
+ **Best practices:**
220
+ - Group only related actions — unrelated buttons should be separated
221
+ - Visually connect buttons with shared border or tight spacing (1–2 px gap)
222
+ - Clearly indicate the active/selected state in toggle-style groups
223
+ - Keep the group to 2–5 buttons; more options warrant a dropdown or overflow menu
224
+
225
+ **Common layouts:**
226
+ - Text editor toolbar (bold, italic, underline)
227
+ - View switcher (grid view, list view)
228
+ - Segmented date range selector (Day, Week, Month)
229
+ - Split button with primary action and a dropdown for alternatives
230
+
231
+ ---
232
+
233
+ ## Card
234
+
235
+ [Browse real examples →](https://component.gallery/components/card/)
236
+
237
+ **Also known as:** Tile
238
+
239
+ A self-contained content block representing a single entity such as a contact, article, or task.
240
+
241
+ **Best practices:**
242
+ - Use a single, clear visual hierarchy within each card: media → title → meta → action
243
+ - Keep cards a consistent height in grid layouts — use line clamping for variable text
244
+ - Make the entire card clickable when it represents a navigable entity
245
+ - Use subtle elevation (shadow) or a border — not both simultaneously
246
+ - Limit card content to essential info; let the detail page carry the rest
247
+
248
+ **Common layouts:**
249
+ - Product grid with image, title, price, and CTA
250
+ - Blog post feed with thumbnail, headline, excerpt, and date
251
+ - Dashboard KPI cards with metric, delta, and sparkline
252
+ - Team member directory with avatar, name, and role
253
+
254
+ ---
255
+
256
+ ## Carousel
257
+
258
+ [Browse real examples →](https://component.gallery/components/carousel/)
259
+
260
+ **Also known as:** Content slider
261
+
262
+ A component that cycles through multiple content slides, navigable via swipe, scroll, or button controls.
263
+
264
+ **Best practices:**
265
+ - Provide visible navigation arrows and pagination dots
266
+ - Support swipe gestures on touch devices
267
+ - Auto-advance only if the user hasn't interacted; pause on hover/focus
268
+ - Show a peek of the next slide to signal scrollability
269
+ - Keep slide count manageable (3–7) — carousels with many slides have low engagement
270
+ - Ensure accessibility: each slide should be reachable via keyboard
271
+
272
+ **Common layouts:**
273
+ - Hero image slideshow on a marketing homepage
274
+ - Product image gallery on a detail page
275
+ - Testimonial carousel with quote, author, and avatar
276
+ - Horizontal scrolling feature highlights in a mobile app
277
+
278
+ ---
279
+
280
+ ## Checkbox
281
+
282
+ [Browse real examples →](https://component.gallery/components/checkbox/)
283
+
284
+ A selection control — use in groups for multi-select from a list, or standalone for a single on/off choice.
285
+
286
+ **Best practices:**
287
+ - Use checkboxes for multi-select, not single toggles (use a switch for on/off)
288
+ - Align the checkbox to the first line of its label, not the center
289
+ - Support indeterminate state for 'select all' when children are partially selected
290
+ - Minimum 44 px touch target including label area
291
+ - Group related checkboxes under a fieldset with a legend for accessibility
292
+
293
+ **Common layouts:**
294
+ - Filter panel with multi-select facets
295
+ - Terms & conditions single checkbox with long label
296
+ - To-do list with check/uncheck per item
297
+ - Table row multi-select with header 'select all'
298
+
299
+ ---
300
+
301
+ ## Color picker
302
+
303
+ [Browse real examples →](https://component.gallery/components/color-picker/)
304
+
305
+ A control that lets users select a color value.
306
+
307
+ **Best practices:**
308
+ - Provide a spectrum picker, hue slider, and direct hex/RGB input
309
+ - Include a set of preset swatches for quick selection
310
+ - Show a real-time preview of the selected color
311
+ - Support copy-paste of hex/RGB/HSL values
312
+ - Remember recently used colors for convenience
313
+
314
+ **Common layouts:**
315
+ - Design tool color picker with spectrum, sliders, and input fields
316
+ - Theme customizer with preset palette and custom override
317
+ - Annotation tool with color swatch row
318
+ - Brand settings with primary/secondary/accent color pickers
319
+
320
+ ---
321
+
322
+ ## Combobox
323
+
324
+ [Browse real examples →](https://component.gallery/components/combobox/)
325
+
326
+ **Also known as:** Autocomplete · Autosuggest
327
+
328
+ A select-like input enhanced with a free-text field that filters available options as you type.
329
+
330
+ **Best practices:**
331
+ - Show suggestions after 1–2 characters to reduce noise
332
+ - Highlight matched text within each suggestion for scannability
333
+ - Allow keyboard navigation (arrow keys + Enter) through the dropdown
334
+ - Show a 'no results' message instead of an empty dropdown
335
+ - Debounce input to avoid excessive API calls (200–300 ms)
336
+
337
+ **Common layouts:**
338
+ - Search bar with autocomplete suggestions
339
+ - Address input with location suggestions
340
+ - Tag input that suggests existing tags
341
+ - Assignee picker in a project management tool
342
+
343
+ ---
344
+
345
+ ## Date input
346
+
347
+ [Browse real examples →](https://component.gallery/components/date-input/)
348
+
349
+ A date entry control, often split into separate day, month, and year fields.
350
+
351
+ **Best practices:**
352
+ - Clearly label the expected format (DD/MM/YYYY or MM/DD/YYYY)
353
+ - Use separate fields for day, month, and year for unambiguous entry
354
+ - Validate in real-time and show errors inline
355
+ - Support auto-advancing between fields when a segment is complete
356
+
357
+ **Common layouts:**
358
+ - Date of birth entry in a registration form
359
+ - Passport/ID expiry date input
360
+ - Invoice date field in a financial form
361
+
362
+ ---
363
+
364
+ ## Datepicker
365
+
366
+ [Browse real examples →](https://component.gallery/components/datepicker/)
367
+
368
+ **Also known as:** Calendar · Datetime picker
369
+
370
+ A calendar-based control for selecting dates visually.
371
+
372
+ **Best practices:**
373
+ - Allow both manual text entry and calendar selection
374
+ - Clearly indicate the expected date format (e.g., MM/DD/YYYY)
375
+ - Highlight today's date and the currently selected date
376
+ - Disable dates outside the valid range
377
+ - Support keyboard navigation through the calendar grid
378
+ - For date ranges, show both start and end in a connected picker
379
+
380
+ **Common layouts:**
381
+ - Booking flow with check-in / check-out range picker
382
+ - Form field with calendar dropdown on focus
383
+ - Dashboard date range filter in a toolbar
384
+ - Event creation form with start date and optional end date
385
+
386
+ ---
387
+
388
+ ## Drawer
389
+
390
+ [Browse real examples →](https://component.gallery/components/drawer/)
391
+
392
+ **Also known as:** Tray · Flyout · Sheet
393
+
394
+ A panel that slides in from a screen edge to reveal secondary content or actions.
395
+
396
+ **Best practices:**
397
+ - Use drawers for secondary content or focused sub-tasks that don't warrant a full page
398
+ - Slide in from the right for detail panels, from the left for navigation
399
+ - Include a clear close button and support Escape to dismiss
400
+ - Dim the background with a semi-transparent overlay to establish focus
401
+ - Width should be 320–480 px on desktop; full-width on mobile
402
+
403
+ **Common layouts:**
404
+ - Mobile navigation menu sliding in from the left
405
+ - Shopping cart preview panel from the right
406
+ - Detail/edit panel in a master-detail layout
407
+ - Notification center sliding in from the right
408
+
409
+ ---
410
+
411
+ ## Dropdown menu
412
+
413
+ [Browse real examples →](https://component.gallery/components/dropdown-menu/)
414
+
415
+ **Also known as:** Select menu
416
+
417
+ A menu triggered by a button that reveals a list of actions or navigation options — unlike a select, it is not a form input.
418
+
419
+ **Best practices:**
420
+ - Group related items with separators and optional group headings
421
+ - Support keyboard navigation: arrow keys to move, Enter to select, Escape to close
422
+ - Keep the menu to 7±2 items; use sub-menus or search for longer lists
423
+ - Position the menu to avoid viewport overflow — flip to top if near bottom edge
424
+ - Indicate destructive actions in red and place them last, separated
425
+
426
+ **Common layouts:**
427
+ - User account menu in the top-right navigation
428
+ - Context menu on right-click or kebab icon
429
+ - Action menu on a table row (Edit, Duplicate, Delete)
430
+ - Sort/filter dropdown in a toolbar
431
+
432
+ ---
433
+
434
+ ## Empty state
435
+
436
+ [Browse real examples →](https://component.gallery/components/empty-state/)
437
+
438
+ A placeholder shown when a view has no data to display, typically paired with a helpful action or suggestion.
439
+
440
+ **Best practices:**
441
+ - Include a clear illustration or icon to soften the empty feeling
442
+ - Write a helpful headline explaining the empty state
443
+ - Provide a primary CTA that guides the user toward the next step
444
+ - Avoid blame — frame it positively ('No projects yet' not 'You have no projects')
445
+ - Show the empty state in-place within the container, not as a full-page takeover
446
+
447
+ **Common layouts:**
448
+ - Empty dashboard with 'Create your first project' CTA
449
+ - Search results page with 'No results found' and suggestions
450
+ - Empty inbox with illustration and encouraging message
451
+ - Empty table with inline prompt to add data
452
+
453
+ ---
454
+
455
+ ## Fieldset
456
+
457
+ [Browse real examples →](https://component.gallery/components/fieldset/)
458
+
459
+ A container that groups related form fields under a shared label or legend.
460
+
461
+ **Best practices:**
462
+ - Use fieldsets to group related form fields under a descriptive legend
463
+ - Style the legend as a section heading within the form
464
+ - Ensure the fieldset is announced by screen readers for context
465
+
466
+ **Common layouts:**
467
+ - Address section grouping street, city, state, and zip fields
468
+ - Payment information section with card number, expiry, and CVV
469
+ - Personal details section in a multi-part form
470
+
471
+ ---
472
+
473
+ ## File
474
+
475
+ [Browse real examples →](https://component.gallery/components/file/)
476
+
477
+ **Also known as:** Attachment · Download
478
+
479
+ A visual representation of a file — such as an uploaded attachment or a downloadable document.
480
+
481
+ **Best practices:**
482
+ - Show file type icon, name, and size clearly
483
+ - Include a download action and optionally a preview action
484
+ - Display upload date or last modified date
485
+ - Use a progress indicator during upload
486
+
487
+ **Common layouts:**
488
+ - Attachment list below a message or form
489
+ - File card with icon, name, size, and download button
490
+ - Document grid with thumbnails and metadata
491
+
492
+ ---
493
+
494
+ ## File upload
495
+
496
+ [Browse real examples →](https://component.gallery/components/file-upload/)
497
+
498
+ **Also known as:** File input · File uploader · Dropzone
499
+
500
+ A control that lets users select and upload files from their device.
501
+
502
+ **Best practices:**
503
+ - Support drag-and-drop with a clearly defined drop zone
504
+ - Show accepted file types and size limits before upload
505
+ - Display upload progress with a progress bar per file
506
+ - Allow cancellation of in-progress uploads
507
+ - Show a preview (thumbnail for images, icon + name for documents) after selection
508
+ - Validate file type and size client-side before uploading
509
+
510
+ **Common layouts:**
511
+ - Profile photo upload with circular crop preview
512
+ - Document attachment area in a form
513
+ - Multi-file drag-and-drop zone with file list below
514
+ - Inline file field with browse button and filename display
515
+
516
+ ---
517
+
518
+ ## Footer
519
+
520
+ [Browse real examples →](https://component.gallery/components/footer/)
521
+
522
+ A region at the bottom of a page or section containing copyright info, legal links, or secondary navigation.
523
+
524
+ **Best practices:**
525
+ - Organize links into clear columns by category
526
+ - Include essential legal links: Privacy Policy, Terms of Service
527
+ - Keep the footer visually distinct but not distracting — muted background
528
+ - Include social links and a newsletter signup if appropriate
529
+ - Ensure the footer is accessible and links are keyboard-navigable
530
+
531
+ **Common layouts:**
532
+ - Multi-column footer with link groups, logo, and copyright
533
+ - Minimal SaaS footer with product links and social icons
534
+ - E-commerce footer with help, shipping, returns, and payment icons
535
+ - Single-line footer with copyright and key legal links
536
+
537
+ ---
538
+
539
+ ## Form
540
+
541
+ [Browse real examples →](https://component.gallery/components/form/)
542
+
543
+ A collection of input controls that allows users to enter and submit structured data.
544
+
545
+ **Best practices:**
546
+ - Use a single-column layout for most forms — it's faster to scan
547
+ - Place labels above inputs for mobile-friendly forms
548
+ - Group related fields with visual proximity and optional fieldset headings
549
+ - Show inline validation on blur, not on every keystroke
550
+ - Disable the submit button until required fields are valid, or show clear errors on submit
551
+ - Keep forms as short as possible — ask only what's necessary
552
+
553
+ **Common layouts:**
554
+ - Sign-up form with name, email, password, and CTA
555
+ - Multi-step wizard form with progress indicator
556
+ - Settings form with grouped preference sections
557
+ - Contact form with name, email, subject, and message textarea
558
+
559
+ ---
560
+
561
+ ## Header
562
+
563
+ [Browse real examples →](https://component.gallery/components/header/)
564
+
565
+ The persistent top-of-page region containing the site brand, primary navigation, and key actions.
566
+
567
+ **Best practices:**
568
+ - Keep the header height compact (56–72 px) to preserve content space
569
+ - Place the logo/brand on the left, primary navigation in the center or right
570
+ - Use a sticky header on long pages but consider auto-hide on scroll-down
571
+ - Ensure the mobile header collapses into a hamburger menu gracefully
572
+ - Maintain clear visual separation from page content (border-bottom or subtle shadow)
573
+
574
+ **Common layouts:**
575
+ - SaaS app header with logo, nav links, search, and user avatar
576
+ - Marketing site header with logo, nav links, and CTA button
577
+ - Dashboard header with breadcrumbs, page title, and action buttons
578
+ - Minimal header with centered logo and hamburger menu
579
+
580
+ ---
581
+
582
+ ## Heading
583
+
584
+ [Browse real examples →](https://component.gallery/components/heading/)
585
+
586
+ A title element that introduces and labels a content section.
587
+
588
+ **Best practices:**
589
+ - Use a strict heading hierarchy (h1 → h2 → h3) for accessibility and SEO
590
+ - Limit to one h1 per page — it's the page title
591
+ - Keep headings concise and descriptive — they're the outline of your content
592
+ - Use consistent sizing, weight, and spacing across heading levels
593
+
594
+ **Common layouts:**
595
+ - Page title (h1) with section headings (h2) and subsections (h3)
596
+ - Card title as an h3 within a page section
597
+ - Dashboard section headers separating widget groups
598
+
599
+ ---
600
+
601
+ ## Hero
602
+
603
+ [Browse real examples →](https://component.gallery/components/hero/)
604
+
605
+ **Also known as:** Jumbotron · Banner
606
+
607
+ A prominent banner near the top of a page, typically featuring a full-width image or illustration with a headline.
608
+
609
+ **Best practices:**
610
+ - Lead with a compelling headline — clarity over cleverness
611
+ - Limit to one primary CTA and optionally one secondary CTA
612
+ - Use a high-quality image or illustration that reinforces the message
613
+ - Ensure text contrast against the background image (overlay or safe text zone)
614
+ - Keep hero height proportional — it should invite scrolling, not dominate the viewport
615
+
616
+ **Common layouts:**
617
+ - Split hero: headline + CTA on left, product screenshot on right
618
+ - Full-bleed background image with centered text overlay
619
+ - Minimal hero with large headline, subtext, and inline email capture
620
+ - Video background hero with centered headline and play button
621
+
622
+ ---
623
+
624
+ ## Icon
625
+
626
+ [Browse real examples →](https://component.gallery/components/icon/)
627
+
628
+ A small graphic symbol that communicates the purpose or meaning of an interface element at a glance.
629
+
630
+ **Best practices:**
631
+ - Use a consistent icon style throughout the product (outlined or filled, not mixed)
632
+ - Size icons to align with adjacent text (typically 16–24 px)
633
+ - Pair icons with text labels for clarity — icon-only buttons need tooltips
634
+ - Use aria-hidden='true' for decorative icons and aria-label for functional ones
635
+
636
+ **Common layouts:**
637
+ - Navigation item with icon + label
638
+ - Action button with icon + text ('Download report')
639
+ - Status indicator icon beside a label (check, warning, error)
640
+ - Icon-only toolbar with tooltips
641
+
642
+ ---
643
+
644
+ ## Image
645
+
646
+ [Browse real examples →](https://component.gallery/components/image/)
647
+
648
+ **Also known as:** Picture
649
+
650
+ A component for displaying embedded images within a page.
651
+
652
+ **Best practices:**
653
+ - Always provide meaningful alt text for accessibility
654
+ - Use responsive images (srcset) to serve appropriate sizes
655
+ - Lazy-load images below the fold for performance
656
+ - Reserve space for images before they load to prevent layout shift
657
+ - Use modern formats (WebP, AVIF) with fallbacks
658
+
659
+ **Common layouts:**
660
+ - Hero banner with full-width background image
661
+ - Product image gallery with thumbnails and zoom
662
+ - Blog post featured image above the title or below the headline
663
+ - Avatar or profile photo in a circular frame
664
+
665
+ ---
666
+
667
+ ## Label
668
+
669
+ [Browse real examples →](https://component.gallery/components/label/)
670
+
671
+ **Also known as:** Form label
672
+
673
+ A text element that identifies and describes a form input.
674
+
675
+ **Best practices:**
676
+ - Always associate labels with their form inputs (htmlFor / id pairing)
677
+ - Place labels above the input for vertical forms, beside for horizontal
678
+ - Mark required fields clearly (asterisk or 'required' text)
679
+ - Keep label text concise — use helper text for additional guidance
680
+
681
+ **Common layouts:**
682
+ - Form field with label above and helper text below
683
+ - Inline label beside a toggle or checkbox
684
+ - Floating label that moves to the top on input focus
685
+
686
+ ---
687
+
688
+ ## Link
689
+
690
+ [Browse real examples →](https://component.gallery/components/link/)
691
+
692
+ **Also known as:** Anchor · Hyperlink
693
+
694
+ A clickable reference to another resource — either an external page or a location within the current document.
695
+
696
+ **Best practices:**
697
+ - Make link text descriptive — avoid 'click here' or 'learn more' in isolation
698
+ - Underline links in body text for discoverability; nav links may rely on context
699
+ - Use a distinct color from surrounding text (but avoid pure blue if it clashes with your palette)
700
+ - Show a visited state for content-heavy pages to aid navigation
701
+ - External links should indicate they open in a new tab (icon or aria-label)
702
+
703
+ **Common layouts:**
704
+ - Inline text link within a paragraph
705
+ - Standalone link beneath a card or section as a 'read more' action
706
+ - Footer link columns for site navigation
707
+ - Breadcrumb links in a hierarchy path
708
+
709
+ ---
710
+
711
+ ## List
712
+
713
+ [Browse real examples →](https://component.gallery/components/list/)
714
+
715
+ A component that groups related items into an ordered or unordered sequence.
716
+
717
+ **Best practices:**
718
+ - Use consistent vertical rhythm — equal spacing between list items
719
+ - For interactive lists, ensure each row has a clear hover and active state
720
+ - Include dividers between items in dense lists; omit them in spacious ones
721
+ - Support keyboard navigation when the list is interactive
722
+ - Use virtualization (windowing) for lists exceeding ~100 items
723
+
724
+ **Common layouts:**
725
+ - Email inbox with sender, subject, preview, and timestamp per row
726
+ - Settings list with label, value/toggle, and optional chevron
727
+ - Activity feed with avatar, description, and relative timestamp
728
+ - File list with icon, name, size, and date columns
729
+
730
+ ---
731
+
732
+ ## Modal
733
+
734
+ [Browse real examples →](https://component.gallery/components/modal/)
735
+
736
+ **Also known as:** Dialog · Popup · Modal window
737
+
738
+ An overlay that demands the user's attention — interaction is required before returning to the content beneath.
739
+
740
+ **Best practices:**
741
+ - Use modals sparingly — only for actions that require immediate attention or focused input
742
+ - Always provide a clear close mechanism: X button, Cancel, and Escape key
743
+ - Trap focus within the modal while it's open for accessibility
744
+ - Return focus to the trigger element when the modal closes
745
+ - Keep modal content concise — if it needs scrolling, consider a full page instead
746
+ - Use a semi-transparent backdrop to dim the underlying content
747
+
748
+ **Common layouts:**
749
+ - Confirmation dialog with message and two action buttons
750
+ - Form modal for quick data entry (create, edit)
751
+ - Image/media preview lightbox
752
+ - Onboarding or announcement modal with illustration and CTA
753
+
754
+ ---
755
+
756
+ ## Navigation
757
+
758
+ [Browse real examples →](https://component.gallery/components/navigation/)
759
+
760
+ **Also known as:** Nav · Menu
761
+
762
+ A region containing links for moving between pages or jumping to sections within the current page.
763
+
764
+ **Best practices:**
765
+ - Limit primary navigation to 5–7 items; group the rest under 'More' or sub-menus
766
+ - Clearly indicate the current/active page in the navigation
767
+ - Use consistent iconography alongside text labels for scannability
768
+ - Collapse to a hamburger or bottom tab bar on mobile
769
+ - Ensure all navigation items are reachable via keyboard (Tab + Enter)
770
+
771
+ **Common layouts:**
772
+ - Horizontal top nav with logo, links, and user menu
773
+ - Vertical sidebar navigation with icon + label and collapsible groups
774
+ - Bottom tab bar for mobile apps (Home, Search, Create, Notifications, Profile)
775
+ - Mega-menu dropdown with categorized link columns
776
+
777
+ ---
778
+
779
+ ## Pagination
780
+
781
+ [Browse real examples →](https://component.gallery/components/pagination/)
782
+
783
+ A control for navigating between pages of content when data is split across multiple views.
784
+
785
+ **Best practices:**
786
+ - Show first, last, and a window of pages around the current one
787
+ - Use ellipsis to indicate skipped pages, not dozens of page numbers
788
+ - Provide Previous/Next buttons in addition to numbered pages
789
+ - Clearly style the current page as selected
790
+ - Consider infinite scroll or 'Load more' for content feeds
791
+
792
+ **Common layouts:**
793
+ - Table footer with page numbers, rows-per-page selector, and total count
794
+ - Search results pagination centered below the results list
795
+ - Blog archive with Previous/Next navigation
796
+ - API documentation with page controls at top and bottom
797
+
798
+ ---
799
+
800
+ ## Popover
801
+
802
+ [Browse real examples →](https://component.gallery/components/popover/)
803
+
804
+ A floating panel that appears on click near its trigger element — unlike a tooltip, it can contain interactive content.
805
+
806
+ **Best practices:**
807
+ - Trigger via click, not hover, to support touch devices and accessibility
808
+ - Position intelligently to avoid clipping at viewport edges
809
+ - Include a subtle arrow/caret pointing to the trigger element
810
+ - Dismiss when clicking outside or pressing Escape
811
+ - Keep popover content brief — it's not a modal
812
+
813
+ **Common layouts:**
814
+ - Color picker dropdown triggered by a swatch
815
+ - User profile preview card on avatar hover/click
816
+ - Quick-edit popover for inline data modification
817
+ - Help tooltip with rich content (text + link)
818
+
819
+ ---
820
+
821
+ ## Progress bar
822
+
823
+ [Browse real examples →](https://component.gallery/components/progress-bar/)
824
+
825
+ **Also known as:** Progress
826
+
827
+ A horizontal indicator showing how far a long-running task has progressed toward completion.
828
+
829
+ **Best practices:**
830
+ - Show a determinate bar when progress is measurable, indeterminate when unknown
831
+ - Include a percentage label for accessibility and clarity
832
+ - Use color to indicate state: blue/green for normal, red for error, amber for warning
833
+ - Animate smoothly — avoid jarring jumps between values
834
+ - Keep the bar visually proportional to its container (not too thin to see)
835
+
836
+ **Common layouts:**
837
+ - File upload progress beneath the file name
838
+ - Onboarding completion bar in a sidebar or header
839
+ - Course progress bar at the top of a lesson page
840
+ - System resource usage bar in a monitoring dashboard
841
+
842
+ ---
843
+
844
+ ## Progress indicator
845
+
846
+ [Browse real examples →](https://component.gallery/components/progress-indicator/)
847
+
848
+ **Also known as:** Progress tracker · Stepper · Steps · Timeline · Meter
849
+
850
+ A visual display of how far a user has advanced through a multi-step process.
851
+
852
+ **Best practices:**
853
+ - Clearly distinguish completed, current, and upcoming steps
854
+ - Use numbered or labeled steps — not just dots
855
+ - Allow users to click back to completed steps if the flow permits
856
+ - Keep the total step count visible so users know the scope
857
+ - Vertically stack steps on mobile for readability
858
+
859
+ **Common layouts:**
860
+ - Multi-step checkout (Cart → Shipping → Payment → Confirmation)
861
+ - Account setup wizard with profile, preferences, and verification
862
+ - Application form with multiple sections
863
+ - Project timeline with milestones
864
+
865
+ ---
866
+
867
+ ## Quote
868
+
869
+ [Browse real examples →](https://component.gallery/components/quote/)
870
+
871
+ **Also known as:** Pull quote · Block quote
872
+
873
+ A styled block for displaying quotations — from a person, an external source, or a highlighted passage.
874
+
875
+ **Best practices:**
876
+ - Use a distinct visual treatment — large quotation marks, left border, or italic text
877
+ - Always attribute the quote to its source
878
+ - Keep pull quotes short — they're attention-grabbers, not paragraphs
879
+
880
+ **Common layouts:**
881
+ - Testimonial block with photo, quote, name, and title
882
+ - Pull quote in a blog post breaking up long text
883
+ - Customer quote in a case study with company logo
884
+
885
+ ---
886
+
887
+ ## Radio button
888
+
889
+ [Browse real examples →](https://component.gallery/components/radio-button/)
890
+
891
+ **Also known as:** Radio · Radio group
892
+
893
+ A selection control where the user picks exactly one option from a predefined set.
894
+
895
+ **Best practices:**
896
+ - Use radio buttons for mutually exclusive choices (select one from many)
897
+ - Always pre-select a sensible default when possible
898
+ - Group under a fieldset with a legend describing the choice
899
+ - Stack vertically for more than 2 options — horizontal only for 2–3 short-label options
900
+ - Provide sufficient spacing between options (at least 8 px) for easy tapping
901
+
902
+ **Common layouts:**
903
+ - Shipping method selection (Standard, Express, Overnight)
904
+ - Payment method chooser with radio + icon + description
905
+ - Survey question with single-choice answers
906
+ - Plan/tier selection in a pricing form
907
+
908
+ ---
909
+
910
+ ## Rating
911
+
912
+ [Browse real examples →](https://component.gallery/components/rating/)
913
+
914
+ A control that displays or captures a star-based score for a product or item.
915
+
916
+ **Best practices:**
917
+ - Use 5-star scale as the widely understood standard
918
+ - Allow half-star precision for display; use full stars for input
919
+ - Show the average rating and total review count together
920
+ - Use filled/empty stars with sufficient color contrast
921
+
922
+ **Common layouts:**
923
+ - Product rating display with stars and review count
924
+ - Review submission with interactive star input and text area
925
+ - Summary rating card with distribution bar chart
926
+
927
+ ---
928
+
929
+ ## Rich text editor
930
+
931
+ [Browse real examples →](https://component.gallery/components/rich-text-editor/)
932
+
933
+ **Also known as:** RTE · WYSIWYG editor
934
+
935
+ A WYSIWYG editing surface for creating and formatting rich text content.
936
+
937
+ **Best practices:**
938
+ - Provide a minimal default toolbar — reveal advanced formatting on demand
939
+ - Support keyboard shortcuts for common formatting (Cmd+B, Cmd+I)
940
+ - Ensure pasted content is sanitized to prevent layout-breaking HTML
941
+ - Show a word/character count for content with limits
942
+
943
+ **Common layouts:**
944
+ - Blog post editor with formatting toolbar and preview
945
+ - Email composer with rich text and attachment support
946
+ - Comment editor with basic formatting (bold, italic, link, list)
947
+
948
+ ---
949
+
950
+ ## Search input
951
+
952
+ [Browse real examples →](https://component.gallery/components/search-input/)
953
+
954
+ **Also known as:** Search
955
+
956
+ A text field designed for entering search queries to find content.
957
+
958
+ **Best practices:**
959
+ - Place a magnifying glass icon inside the field to signal purpose
960
+ - Support Cmd/Ctrl+K as a global shortcut to focus the search
961
+ - Show recent searches and suggested queries in a dropdown
962
+ - Debounce input and show a loading indicator during server queries
963
+ - Provide a clear/reset button (×) once text is entered
964
+
965
+ **Common layouts:**
966
+ - Global search in the top navigation bar
967
+ - Command palette overlay (Cmd+K) with categorized results
968
+ - Inline search/filter above a data table
969
+ - Full-page search with prominent input and categorized results below
970
+
971
+ ---
972
+
973
+ ## Segmented control
974
+
975
+ [Browse real examples →](https://component.gallery/components/segmented-control/)
976
+
977
+ **Also known as:** Toggle button group
978
+
979
+ A compact row of mutually exclusive options — a hybrid of button groups, radio buttons, and tabs for switching views.
980
+
981
+ **Best practices:**
982
+ - Limit to 2–5 segments — more options warrant tabs or a dropdown
983
+ - Use equal-width segments for visual balance
984
+ - Animate the selection indicator sliding between options
985
+ - Ensure the selected state has strong contrast against unselected
986
+ - Use sentence case for segment labels
987
+
988
+ **Common layouts:**
989
+ - Map/list/grid view switcher
990
+ - Billing period toggle (Monthly / Annually)
991
+ - Light/dark mode toggle in settings
992
+ - Chart type selector (Line, Bar, Pie)
993
+
994
+ ---
995
+
996
+ ## Select
997
+
998
+ [Browse real examples →](https://component.gallery/components/select/)
999
+
1000
+ **Also known as:** Dropdown · Select input
1001
+
1002
+ A form input that shows the current selection when collapsed and reveals a scrollable option list when expanded.
1003
+
1004
+ **Best practices:**
1005
+ - Use native select for simple use cases (better accessibility and mobile UX)
1006
+ - For custom selects, ensure full keyboard support and ARIA attributes
1007
+ - Show a placeholder label ('Select an option…') when no value is chosen
1008
+ - Group long option lists with optgroups or headings
1009
+ - For searchable selects with many options, combine with combobox behavior
1010
+
1011
+ **Common layouts:**
1012
+ - Country/region picker in an address form
1013
+ - Sort-by dropdown in a product listing toolbar
1014
+ - Role selector in a user invitation flow
1015
+ - Language/locale switcher
1016
+
1017
+ ---
1018
+
1019
+ ## Separator
1020
+
1021
+ [Browse real examples →](https://component.gallery/components/separator/)
1022
+
1023
+ **Also known as:** Divider · Horizontal rule · Vertical rule
1024
+
1025
+ A visual divider — typically a horizontal or vertical line — used to separate content sections.
1026
+
1027
+ **Best practices:**
1028
+ - Use subtle, low-contrast separators — they guide the eye, not dominate it
1029
+ - Prefer spacing over separators when grouping is already clear
1030
+ - Use horizontal rules between content sections, vertical rules between columns
1031
+
1032
+ **Common layouts:**
1033
+ - Horizontal divider between list items or content sections
1034
+ - Vertical separator between sidebar and main content
1035
+ - Section divider with centered label ('or', 'related content')
1036
+
1037
+ ---
1038
+
1039
+ ## Skeleton
1040
+
1041
+ [Browse real examples →](https://component.gallery/components/skeleton/)
1042
+
1043
+ **Also known as:** Skeleton loader
1044
+
1045
+ A low-fidelity placeholder that mimics the shape of content while it loads, typically rendered as grey blocks.
1046
+
1047
+ **Best practices:**
1048
+ - Match the skeleton shape to the actual content layout as closely as possible
1049
+ - Use a subtle shimmer/pulse animation to indicate loading — not a spinner
1050
+ - Avoid skeletons for very fast loads (<300 ms) — they add visual noise
1051
+ - Show skeleton immediately on navigation; replace atomically when data arrives
1052
+ - Use muted, low-contrast colors (light gray on white) for skeleton blocks
1053
+
1054
+ **Common layouts:**
1055
+ - Card grid skeleton with image placeholder, title bar, and text lines
1056
+ - List/feed skeleton with repeating row shapes
1057
+ - Profile page skeleton with avatar circle and text blocks
1058
+ - Dashboard skeleton with chart placeholder and metric blocks
1059
+
1060
+ ---
1061
+
1062
+ ## Skip link
1063
+
1064
+ [Browse real examples →](https://component.gallery/components/skip-link/)
1065
+
1066
+ Hidden navigation links that let keyboard users jump directly to the main content, bypassing repeated elements.
1067
+
1068
+ **Best practices:**
1069
+ - Make it the first focusable element in the DOM
1070
+ - Visually hidden until focused — then clearly visible
1071
+ - Link to the main content area with a descriptive label ('Skip to main content')
1072
+
1073
+ **Common layouts:**
1074
+ - Hidden link that appears on Tab focus at the very top of the page
1075
+
1076
+ ---
1077
+
1078
+ ## Slider
1079
+
1080
+ [Browse real examples →](https://component.gallery/components/slider/)
1081
+
1082
+ **Also known as:** Range input
1083
+
1084
+ A draggable control for selecting a value from within a defined range.
1085
+
1086
+ **Best practices:**
1087
+ - Show the current value in a tooltip or adjacent label
1088
+ - Use tick marks for discrete value sliders
1089
+ - Support both dragging and clicking on the track to set value
1090
+ - Ensure minimum touch target size for the thumb (44 px)
1091
+ - Pair with a text input for precise value entry when needed
1092
+
1093
+ **Common layouts:**
1094
+ - Price range filter with dual thumbs (min/max)
1095
+ - Volume/brightness control slider
1096
+ - Image crop zoom level control
1097
+ - Pricing page seat/usage slider with dynamic price display
1098
+
1099
+ ---
1100
+
1101
+ ## Spinner
1102
+
1103
+ [Browse real examples →](https://component.gallery/components/spinner/)
1104
+
1105
+ **Also known as:** Loader · Loading
1106
+
1107
+ An animated indicator showing that a background process is running and the interface isn't yet interactive.
1108
+
1109
+ **Best practices:**
1110
+ - Show spinners only after a delay (~300 ms) to avoid flicker on fast responses
1111
+ - Size the spinner proportionally to the context: inline (16 px), button (20 px), page (40+ px)
1112
+ - Use a single brand-consistent spinner design throughout the app
1113
+ - Provide an aria-label or sr-only text for screen readers ('Loading…')
1114
+ - Prefer skeleton screens over spinners when the layout is predictable
1115
+
1116
+ **Common layouts:**
1117
+ - Centered full-page spinner during initial app load
1118
+ - Inline spinner inside a button during form submission
1119
+ - Small spinner beside a table cell during lazy-loaded data fetch
1120
+ - Overlay spinner on a card while its content refreshes
1121
+
1122
+ ---
1123
+
1124
+ ## Stack
1125
+
1126
+ [Browse real examples →](https://component.gallery/components/stack/)
1127
+
1128
+ A layout utility that applies uniform spacing between its child components.
1129
+
1130
+ **Best practices:**
1131
+ - Use a consistent spacing scale (4, 8, 12, 16, 24, 32, 48 px)
1132
+ - Default to vertical stacking; support horizontal for inline element groups
1133
+ - Use stack as a layout primitive to enforce consistent spacing across components
1134
+
1135
+ **Common layouts:**
1136
+ - Vertical stack of form fields with uniform gap
1137
+ - Horizontal stack of action buttons with gap
1138
+ - Card content layout with vertical stack of title, description, and meta
1139
+
1140
+ ---
1141
+
1142
+ ## Stepper
1143
+
1144
+ [Browse real examples →](https://component.gallery/components/stepper/)
1145
+
1146
+ **Also known as:** Nudger · Quantity · Counter
1147
+
1148
+ A numeric input with increment and decrement buttons for adjusting a value.
1149
+
1150
+ **Best practices:**
1151
+ - Use clear +/- buttons with adequate touch targets
1152
+ - Allow direct number entry in addition to button interaction
1153
+ - Set sensible min, max, and step values
1154
+ - Disable the relevant button when at min or max value
1155
+
1156
+ **Common layouts:**
1157
+ - Quantity selector in an e-commerce cart
1158
+ - Number input for seat count in a booking flow
1159
+ - Portion size adjuster in a recipe app
1160
+
1161
+ ---
1162
+
1163
+ ## Table
1164
+
1165
+ [Browse real examples →](https://component.gallery/components/table/)
1166
+
1167
+ A structured grid of rows and columns for displaying data — often called a data table when it supports sorting and filtering.
1168
+
1169
+ **Best practices:**
1170
+ - Use a sticky header row for scrollable tables
1171
+ - Right-align numeric columns for easy comparison
1172
+ - Provide sortable column headers with clear sort direction indicators
1173
+ - Alternate row colors (zebra striping) or use horizontal dividers for readability
1174
+ - Include a bulk-select checkbox column for actionable tables
1175
+ - Make tables horizontally scrollable on mobile rather than hiding columns
1176
+
1177
+ **Common layouts:**
1178
+ - Admin data table with search, filters, sort, pagination, and row actions
1179
+ - Pricing comparison table with feature rows and plan columns
1180
+ - Financial ledger with date, description, amount, and running balance
1181
+ - Leaderboard table with rank, name, avatar, and score
1182
+
1183
+ ---
1184
+
1185
+ ## Tabs
1186
+
1187
+ [Browse real examples →](https://component.gallery/components/tabs/)
1188
+
1189
+ **Also known as:** Tabbed interface
1190
+
1191
+ A set of selectable labels that switch between content panels, keeping the layout compact.
1192
+
1193
+ **Best practices:**
1194
+ - Limit to 2–7 tabs; more options need a scrollable tab bar or dropdown overflow
1195
+ - Clearly indicate the active tab with a bottom border, background fill, or bold text
1196
+ - Use short, descriptive tab labels (1–2 words)
1197
+ - Place tab content immediately below the tab bar with no visual gap
1198
+ - Support keyboard navigation: arrow keys between tabs, Tab to content
1199
+ - Consider swapping tabs for an accordion on narrow viewports
1200
+
1201
+ **Common layouts:**
1202
+ - Product page with Description, Reviews, and Specifications tabs
1203
+ - Settings page with General, Security, Notifications sections
1204
+ - Profile page with Activity, Projects, and Settings tabs
1205
+ - Dashboard with different report views (Overview, Analytics, Logs)
1206
+
1207
+ ---
1208
+
1209
+ ## Text input
1210
+
1211
+ [Browse real examples →](https://component.gallery/components/text-input/)
1212
+
1213
+ A single-line form field for entering short text values.
1214
+
1215
+ **Best practices:**
1216
+ - Use appropriate input types (email, tel, url, number) for mobile keyboard optimization
1217
+ - Show placeholder text only as an example format, never as a label replacement
1218
+ - Display character count for length-limited fields
1219
+ - Show inline validation errors below the input with a red border and message
1220
+ - Support autofill attributes for common fields (name, email, address)
1221
+
1222
+ **Common layouts:**
1223
+ - Login form with email and password inputs
1224
+ - Search bar with icon prefix and clear button
1225
+ - Inline edit field that converts from text to input on click
1226
+ - Settings form with labeled text inputs in a single column
1227
+
1228
+ ---
1229
+
1230
+ ## Textarea
1231
+
1232
+ [Browse real examples →](https://component.gallery/components/textarea/)
1233
+
1234
+ **Also known as:** Textbox · Text box
1235
+
1236
+ A multi-line text field for longer content entry.
1237
+
1238
+ **Best practices:**
1239
+ - Allow vertical resizing but consider setting a min and max height
1240
+ - Show character count if there's a limit
1241
+ - Use a taller default height (3–5 rows) to signal multi-line input is expected
1242
+ - Auto-grow the textarea as the user types for a smoother experience
1243
+
1244
+ **Common layouts:**
1245
+ - Comment or reply input below a post
1246
+ - Feedback form with a large message area
1247
+ - Note-taking field in a CRM or project tool
1248
+ - Code or JSON input with monospace font
1249
+
1250
+ ---
1251
+
1252
+ ## Toast
1253
+
1254
+ [Browse real examples →](https://component.gallery/components/toast/)
1255
+
1256
+ **Also known as:** Snackbar
1257
+
1258
+ A brief, non-blocking notification that appears in a floating layer above the interface.
1259
+
1260
+ **Best practices:**
1261
+ - Auto-dismiss after 4–6 seconds for non-critical toasts
1262
+ - Allow manual dismissal with a close button or swipe
1263
+ - Stack multiple toasts with the newest on top
1264
+ - Position in a consistent corner — bottom-right is most common for desktop
1265
+ - Include an action link for undoable operations ('Undo' for delete)
1266
+ - Limit to one line of text — toasts are for brief confirmations
1267
+
1268
+ **Common layouts:**
1269
+ - Success toast after saving a form ('Changes saved')
1270
+ - Error toast with retry action after a failed request
1271
+ - Undo toast after deleting an item ('Item deleted. Undo')
1272
+ - Notification toast with avatar and brief message preview
1273
+
1274
+ ---
1275
+
1276
+ ## Toggle
1277
+
1278
+ [Browse real examples →](https://component.gallery/components/toggle/)
1279
+
1280
+ **Also known as:** Switch · Lightswitch · Toggle button
1281
+
1282
+ A binary switch control that toggles between two states — typically on and off.
1283
+
1284
+ **Best practices:**
1285
+ - Use for binary on/off settings that take effect immediately
1286
+ - Label the toggle with what it controls, not 'On/Off'
1287
+ - Show the current state visually (color, position) and with an optional text label
1288
+ - Size the toggle to be easily tappable (44+ px wide)
1289
+ - Avoid using toggles inside forms that require a Save action — use checkboxes instead
1290
+
1291
+ **Common layouts:**
1292
+ - Settings row with label on the left and toggle on the right
1293
+ - Dark mode toggle in a header or settings panel
1294
+ - Feature flag toggles in an admin panel
1295
+ - Notification preference toggles in a list
1296
+
1297
+ ---
1298
+
1299
+ ## Tooltip
1300
+
1301
+ [Browse real examples →](https://component.gallery/components/tooltip/)
1302
+
1303
+ **Also known as:** Toggletip
1304
+
1305
+ A small floating label that reveals supplementary information about an element, typically on hover.
1306
+
1307
+ **Best practices:**
1308
+ - Use tooltips for supplementary info — never for essential content
1309
+ - Trigger on hover (desktop) and long-press (mobile); avoid click-to-show
1310
+ - Show after a short delay (~300 ms) and hide on mouse leave
1311
+ - Keep tooltip text to a single sentence or a few words
1312
+ - Position to avoid obscuring the trigger element or important content
1313
+ - Use a toggletip (click-triggered) when the content includes interactive elements
1314
+
1315
+ **Common layouts:**
1316
+ - Icon button tooltip showing the action name
1317
+ - Truncated text tooltip revealing the full string on hover
1318
+ - Info icon tooltip explaining a form field's purpose
1319
+ - Chart data point tooltip showing exact values
1320
+
1321
+ ---
1322
+
1323
+ ## Tree view
1324
+
1325
+ [Browse real examples →](https://component.gallery/components/tree-view/)
1326
+
1327
+ A collapsible, nested hierarchy for browsing structured data like file trees or category taxonomies.
1328
+
1329
+ **Best practices:**
1330
+ - Use indentation (16–24 px per level) to show hierarchy
1331
+ - Include expand/collapse toggles (chevron or triangle) for parent nodes
1332
+ - Support keyboard navigation: arrows to traverse, Enter to select, +/- to expand/collapse
1333
+ - Highlight the selected node and show a focus indicator
1334
+ - Lazy-load deep children for performance in large trees
1335
+
1336
+ **Common layouts:**
1337
+ - File/folder browser in a code editor or CMS
1338
+ - Category tree in an e-commerce sidebar
1339
+ - Organization chart or reporting hierarchy
1340
+ - Table of contents navigation for documentation
1341
+
1342
+ ---
1343
+
1344
+ ## Video
1345
+
1346
+ [Browse real examples →](https://component.gallery/components/video/)
1347
+
1348
+ **Also known as:** Video player
1349
+
1350
+ A media component for playing video content, typically with controls for playback, volume, and fullscreen.
1351
+
1352
+ **Best practices:**
1353
+ - Show a poster/thumbnail image before playback
1354
+ - Include captions/subtitles for accessibility
1355
+ - Provide standard controls: play/pause, volume, fullscreen, progress bar
1356
+ - Lazy-load video content and avoid autoplay with sound
1357
+
1358
+ **Common layouts:**
1359
+ - Product demo video centered on a landing page
1360
+ - Video player with title, description, and related videos
1361
+ - Background video hero with muted autoplay
1362
+ - Tutorial video embedded in documentation
1363
+
1364
+ ---
1365
+
1366
+ ## Visually hidden
1367
+
1368
+ [Browse real examples →](https://component.gallery/components/visually-hidden/)
1369
+
1370
+ **Also known as:** Screenreader only
1371
+
1372
+ Content that is hidden visually but remains accessible to screen readers and other assistive technology.
1373
+
1374
+ **Best practices:**
1375
+ - Use for screen-reader-only text that provides context invisible users don't need
1376
+ - Never use display:none or visibility:hidden — use a clip-rect technique
1377
+ - Apply to skip links, icon-only button labels, and form field instructions
1378
+
1379
+ **Common layouts:**
1380
+ - Hidden label for an icon-only close button
1381
+ - Screen-reader instructions for a complex widget
1382
+
1383
+ ---