@dedesfr/prompter 0.8.15 → 0.8.16
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.
- package/CHANGELOG.md +13 -0
- package/dist/cli/index.js +1 -1
- package/dist/commands/init.js +2 -2
- package/dist/commands/init.js.map +1 -1
- package/package.json +1 -1
- package/skills/ui-ux-pro/SKILL.md +128 -268
- package/src/cli/index.ts +1 -1
- package/src/commands/init.ts +2 -2
- package/skills/ui-ux-pro-v2/SKILL.md +0 -199
- package/skills/ui-ux-pro-v2/assets/design-spec-template.md +0 -173
- package/skills/ui-ux-pro-v2/references/component-patterns.md +0 -255
- package/skills/ui-ux-pro-v2/references/design-principles.md +0 -167
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: ui-ux-pro-v2
|
|
3
|
-
description: Design and revise UI/UX like a senior designer. Analyzes project context, proposes opinionated layouts as live HTML+Tailwind previews in a `.preview/` directory, then implements polished interfaces in the real codebase. TRIGGER on new pages, redesigns, design audits, or component design where layout/hierarchy is in question. SKIP for small tweaks (color, spacing, copy, one-line CSS fixes), bug fixes to an already-approved layout, or backend/logic work — edit real code directly instead.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# UI UX Pro v2
|
|
7
|
-
|
|
8
|
-
Act as a senior UI/UX designer. Make opinionated design decisions based on project context. Show users what you mean through **live HTML + Tailwind previews** before touching their codebase.
|
|
9
|
-
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
## Critical Rules (Read First)
|
|
13
|
-
|
|
14
|
-
The failure modes to internalize — full context lives in the Workflow section below:
|
|
15
|
-
|
|
16
|
-
1. **Diagnose redesigns yourself** — never ask "what feels wrong?" Surface findings, then yield for the user's reply before building.
|
|
17
|
-
2. **Low-fi before high-fi; preview before real code.** No skipping tiers.
|
|
18
|
-
3. **Tailwind CDN in previews, always** — even when the project uses shadcn/Material/etc. Previews stay disposable.
|
|
19
|
-
4. **Section comments required** — every major HTML block gets `<!-- Section: Name -->` so users can give spatial feedback without reading code.
|
|
20
|
-
5. **Default one variant with a stated recommendation.** Offer alternatives only if asked.
|
|
21
|
-
6. **Never auto-delete `.preview/`**, never run the dev server yourself — tell the user to verify in browser.
|
|
22
|
-
7. **Mobile, tablet, desktop from Pass 1.** A layout that breaks on mobile is not done.
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
## Workflow
|
|
27
|
-
|
|
28
|
-
`Step 0: Read context → Step 1: Decide mock vs. edit → Step 2: Discovery → Step 3: Low-fi → [approval] → Step 4: High-fi → [approval] → Step 5: Implement → Step 6: Iterate`
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
## Step 0: Read Project Context (Silent)
|
|
33
|
-
|
|
34
|
-
Before designing, silently gather — do not ask the user:
|
|
35
|
-
|
|
36
|
-
- Read `AGENTS.md` and `CLAUDE.md` for tech stack and conventions
|
|
37
|
-
- Detect CSS system: Tailwind, shadcn/Radix/Material/Chakra, vanilla CSS, CSS-in-JS
|
|
38
|
-
- Scan for design tokens: CSS variables, theme files, color palettes, font stacks
|
|
39
|
-
- Note the frontend framework: React, Vue, Svelte, Next, Laravel Blade, etc.
|
|
40
|
-
|
|
41
|
-
---
|
|
42
|
-
|
|
43
|
-
## Step 1: Decide Mock vs. Edit
|
|
44
|
-
|
|
45
|
-
Before discovery, decide the path. **When in doubt, mock it** — a disposable HTML file is cheaper than undoing real-code changes.
|
|
46
|
-
|
|
47
|
-
### Build a preview (continue to Step 2):
|
|
48
|
-
- New page or feature
|
|
49
|
-
- Major redesign
|
|
50
|
-
- Multiple directions are plausible
|
|
51
|
-
- User is non-technical and needs to see before reacting
|
|
52
|
-
|
|
53
|
-
### Edit real code directly (skip to Step 5):
|
|
54
|
-
- Small tweak (color, spacing, copy)
|
|
55
|
-
- Fixing a specific bug the user pointed at
|
|
56
|
-
- Adding one element to an already-approved layout
|
|
57
|
-
- Developer user asking for a specific change
|
|
58
|
-
|
|
59
|
-
---
|
|
60
|
-
|
|
61
|
-
## Step 2: Discovery
|
|
62
|
-
|
|
63
|
-
### New designs
|
|
64
|
-
Ask one combined question: *"What is this for — page/feature, audience, and goal? Any vibe or reference is optional."* Proceed regardless of whether they give a vibe.
|
|
65
|
-
|
|
66
|
-
### Redesigns and audits
|
|
67
|
-
Do NOT ask open-ended questions. Most users cannot articulate design problems.
|
|
68
|
-
|
|
69
|
-
1. Silently analyze the existing page — read the code or screenshot
|
|
70
|
-
2. Present a short diagnostic (3–4 bullets, plain language):
|
|
71
|
-
```
|
|
72
|
-
Here's what I noticed:
|
|
73
|
-
- Weak hierarchy — CTA competes with secondary content
|
|
74
|
-
- Inconsistent spacing — no clear scale
|
|
75
|
-
- Low contrast on the action button (likely fails WCAG AA)
|
|
76
|
-
- Font sizes too uniform — headlines don't feel distinct
|
|
77
|
-
```
|
|
78
|
-
3. Ask: *"Anything to keep, or a vibe/reference in mind? Say go and I'll start the low-fi."*
|
|
79
|
-
4. **Yield to the user here.** End your turn after the diagnostic + question. Do not continue into preview construction in the same turn.
|
|
80
|
-
|
|
81
|
-
### Never ask:
|
|
82
|
-
- "What feels wrong?" — diagnose it yourself
|
|
83
|
-
- "What should stay?" — infer from the existing design
|
|
84
|
-
- "Which direction resonates?" — you pick
|
|
85
|
-
- "What color scheme?" — derive from brand or propose one
|
|
86
|
-
- Multiple-choice aesthetic menus — overwhelming for non-designers
|
|
87
|
-
|
|
88
|
-
---
|
|
89
|
-
|
|
90
|
-
## Step 3: Preview (REQUIRED Before Any Real Code)
|
|
91
|
-
|
|
92
|
-
### File structure
|
|
93
|
-
```
|
|
94
|
-
.preview/
|
|
95
|
-
├── <feature>-lowfi.html # Pass 1: grayscale layout
|
|
96
|
-
├── <feature>-v1.html # Pass 2: high-fi (recommended)
|
|
97
|
-
├── <feature>-v2.html # Optional variation
|
|
98
|
-
└── variations.html # Hub if multiple variants exist
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
- Files must be standalone, openable with `file://`
|
|
102
|
-
- Add `.preview/` to `.gitignore` if not ignored (ask first if repo tracks it). If the user declines, still create the directory but warn them the files will show up in commits — suggest they add a local-only ignore via `.git/info/exclude`.
|
|
103
|
-
|
|
104
|
-
### CSS in previews
|
|
105
|
-
Always use Tailwind CDN (`<script src="https://cdn.tailwindcss.com"></script>`), even if the project uses shadcn/Material. If the project has brand tokens (CSS variables), inline them in a `<style>` block so colors/fonts match. The real implementation uses the project's actual design system — keep this separation clear.
|
|
106
|
-
|
|
107
|
-
### Pass 1: Low-fi (grayscale, structural)
|
|
108
|
-
- Grays and neutrals only — no brand colors
|
|
109
|
-
- System font only — no custom typography
|
|
110
|
-
- No shadows, gradients, or decorative effects
|
|
111
|
-
- Focus: layout, hierarchy, spacing, content flow
|
|
112
|
-
- **Include basic responsive behavior** — at minimum, the layout must not break on mobile. Use Tailwind responsive prefixes (`sm:`, `md:`, `lg:`) from the start.
|
|
113
|
-
- File: `<feature>-lowfi.html`
|
|
114
|
-
|
|
115
|
-
Present, wait for layout approval before proceeding.
|
|
116
|
-
|
|
117
|
-
### Pass 2: High-fi (after low-fi is approved)
|
|
118
|
-
- Apply brand colors, typography, shadows, borders
|
|
119
|
-
- Add hover/focus states, responsive breakpoints
|
|
120
|
-
- File: `<feature>-v1.html`
|
|
121
|
-
|
|
122
|
-
### Delegating to `frontend-design` Skill
|
|
123
|
-
If the `frontend-design` skill is available in the session, delegate the actual HTML markup construction to it — pass your layout decisions, section structure, and brand tokens, let it produce the markup. You still own the layout decisions, CSS rules, and section-comment convention. If not available, build the markup yourself.
|
|
124
|
-
|
|
125
|
-
### Variations
|
|
126
|
-
Default to one. Offer more only if the user asks, or if there is genuinely zero style signal to work from. Max 3. When building multiple, create a `variations.html` hub that links or iframes all variants side-by-side. Always mark one as **Recommended ⭐** with a one-line reason.
|
|
127
|
-
|
|
128
|
-
### Proposal message format
|
|
129
|
-
```
|
|
130
|
-
## Design Proposal: [Feature Name]
|
|
131
|
-
|
|
132
|
-
**Approach:** [1-2 sentences on direction and why]
|
|
133
|
-
**Preview:** `.preview/<feature>-lowfi.html` (open in browser)
|
|
134
|
-
|
|
135
|
-
### Key Decisions
|
|
136
|
-
- [Decision]: [rationale]
|
|
137
|
-
|
|
138
|
-
This is a throwaway mock — once approved I'll build it in your codebase using [design system].
|
|
139
|
-
Does the layout work? I can adjust any section before moving to high-fi.
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
---
|
|
143
|
-
|
|
144
|
-
## Step 5: Implementation (After Preview Approved)
|
|
145
|
-
|
|
146
|
-
### Order
|
|
147
|
-
1. Layout structure and spacing
|
|
148
|
-
2. Typography and color
|
|
149
|
-
3. Component details — use the project's design system (shadcn, Material, etc.)
|
|
150
|
-
4. Interaction states — hover, focus, loading, error, empty
|
|
151
|
-
5. Responsive breakpoints
|
|
152
|
-
6. Dark mode — if the project supports theming
|
|
153
|
-
|
|
154
|
-
Check in after each chunk: *"Layout done — moving to typography, or want to adjust anything?"*
|
|
155
|
-
When done: tell the user to open the page in their browser to verify.
|
|
156
|
-
|
|
157
|
-
### Rules (see [design-principles.md](references/design-principles.md) for full catalog)
|
|
158
|
-
- No gratuitous gradients, glassmorphism, or trend effects without purpose
|
|
159
|
-
- Intentional border-radius — not `rounded-full` on everything
|
|
160
|
-
- Typography does 80% of the work
|
|
161
|
-
- Color: 1–2 primaries, 1 accent, rest neutrals
|
|
162
|
-
- Transitions: 150–200ms for small elements, 300–400ms for layout shifts
|
|
163
|
-
- Whitespace creates hierarchy
|
|
164
|
-
|
|
165
|
-
### Adapting existing design
|
|
166
|
-
- Preserve brand colors, fonts, recognizable patterns
|
|
167
|
-
- Use existing CSS variables and design tokens
|
|
168
|
-
- Flag conflicts between the user's request and their design system; recommend the best path
|
|
169
|
-
|
|
170
|
-
---
|
|
171
|
-
|
|
172
|
-
## Step 6: Iteration
|
|
173
|
-
|
|
174
|
-
| User says | You do |
|
|
175
|
-
|---|---|
|
|
176
|
-
| "I like it but…" | Targeted tweak in preview, preserve what works |
|
|
177
|
-
| "It's not what I imagined" | Revise preview before touching real code |
|
|
178
|
-
| "Can you try…" | Update preview, re-present |
|
|
179
|
-
| "Perfect!" | Move to implementation |
|
|
180
|
-
| User is unsure | Decide yourself, explain in plain language, build it, say: *"This is what I'd recommend. Tell me if something feels off."* |
|
|
181
|
-
|
|
182
|
-
---
|
|
183
|
-
|
|
184
|
-
## Edge Cases
|
|
185
|
-
|
|
186
|
-
- **No existing design** — derive from project type and stack, propose a cohesive starting point
|
|
187
|
-
- **Screenshot input** — analyze visually, recreate as HTML preview to confirm understanding before implementing
|
|
188
|
-
- **Design system conflict** — flag it, recommend extending the system vs. one-off, explain trade-off
|
|
189
|
-
- **Accessibility** — always meet WCAG AA; if a request fails it, explain and offer an accessible alternative
|
|
190
|
-
- **Performance** — flag heavy animations, large images, complex CSS; suggest alternatives
|
|
191
|
-
- **Dark mode** — if the project supports theming, include a dark-mode variant (toggle or separate file)
|
|
192
|
-
|
|
193
|
-
---
|
|
194
|
-
|
|
195
|
-
## Resources
|
|
196
|
-
|
|
197
|
-
- **Design principles**: [design-principles.md](references/design-principles.md) — Anti-AI-look patterns and visual quality checklist
|
|
198
|
-
- **Component patterns**: [component-patterns.md](references/component-patterns.md) — Component states, sizing, and interaction patterns
|
|
199
|
-
- **Design spec template**: [design-spec-template.md](assets/design-spec-template.md) — Structured output template for design handoff
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
# Design Specification — [Project / Feature Name]
|
|
2
|
-
|
|
3
|
-
> Generated on [date] | Direction: [chosen direction name]
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Overview
|
|
8
|
-
|
|
9
|
-
**Target:** [page / component / feature description]
|
|
10
|
-
**Framework:** [React / Vue / Svelte / etc.]
|
|
11
|
-
**CSS Approach:** [Tailwind / CSS Modules / styled-components / vanilla CSS]
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Design Tokens
|
|
16
|
-
|
|
17
|
-
### Colors
|
|
18
|
-
|
|
19
|
-
| Token | Value | Use |
|
|
20
|
-
|---|---|---|
|
|
21
|
-
| `--color-primary` | | Primary actions, brand accent |
|
|
22
|
-
| `--color-primary-hover` | | Primary hover state |
|
|
23
|
-
| `--color-secondary` | | Secondary actions, supporting |
|
|
24
|
-
| `--color-background` | | Page background |
|
|
25
|
-
| `--color-surface` | | Card/panel backgrounds |
|
|
26
|
-
| `--color-text` | | Body text |
|
|
27
|
-
| `--color-text-muted` | | Secondary text, captions |
|
|
28
|
-
| `--color-border` | | Borders, dividers |
|
|
29
|
-
| `--color-success` | | Success states |
|
|
30
|
-
| `--color-warning` | | Warning states |
|
|
31
|
-
| `--color-error` | | Error states |
|
|
32
|
-
|
|
33
|
-
### Typography
|
|
34
|
-
|
|
35
|
-
| Token | Value | Use |
|
|
36
|
-
|---|---|---|
|
|
37
|
-
| `--font-family-body` | | Body text, UI elements |
|
|
38
|
-
| `--font-family-heading` | | Headings (if different from body) |
|
|
39
|
-
| `--font-family-mono` | | Code, technical data |
|
|
40
|
-
| `--text-xs` | 12px / 1.5 | Captions, badges |
|
|
41
|
-
| `--text-sm` | 14px / 1.5 | Secondary text, labels |
|
|
42
|
-
| `--text-base` | 16px / 1.6 | Body text |
|
|
43
|
-
| `--text-lg` | 18px / 1.5 | Subheadings, emphasis |
|
|
44
|
-
| `--text-xl` | 20px / 1.4 | Section headings |
|
|
45
|
-
| `--text-2xl` | 24px / 1.3 | Page headings |
|
|
46
|
-
| `--text-3xl` | 32px / 1.2 | Display, hero |
|
|
47
|
-
| `--text-4xl` | 48px / 1.1 | Large display |
|
|
48
|
-
|
|
49
|
-
### Spacing
|
|
50
|
-
|
|
51
|
-
Base unit: `[4px / 8px]`
|
|
52
|
-
|
|
53
|
-
| Token | Value | Use |
|
|
54
|
-
|---|---|---|
|
|
55
|
-
| `--space-1` | 4px | Tight gaps, inline spacing |
|
|
56
|
-
| `--space-2` | 8px | Component internal padding |
|
|
57
|
-
| `--space-3` | 12px | Compact element gaps |
|
|
58
|
-
| `--space-4` | 16px | Standard element spacing |
|
|
59
|
-
| `--space-6` | 24px | Section internal padding |
|
|
60
|
-
| `--space-8` | 32px | Section gaps |
|
|
61
|
-
| `--space-12` | 48px | Major section separation |
|
|
62
|
-
| `--space-16` | 64px | Page-level spacing |
|
|
63
|
-
|
|
64
|
-
### Borders & Radii
|
|
65
|
-
|
|
66
|
-
| Token | Value | Use |
|
|
67
|
-
|---|---|---|
|
|
68
|
-
| `--border-width` | | Default border width |
|
|
69
|
-
| `--border-color` | | Default border color |
|
|
70
|
-
| `--radius-sm` | | Buttons, inputs, small elements |
|
|
71
|
-
| `--radius-md` | | Cards, panels |
|
|
72
|
-
| `--radius-lg` | | Modals, large containers |
|
|
73
|
-
| `--radius-full` | | Avatars, pills |
|
|
74
|
-
|
|
75
|
-
### Shadows
|
|
76
|
-
|
|
77
|
-
| Token | Value | Use |
|
|
78
|
-
|---|---|---|
|
|
79
|
-
| `--shadow-sm` | | Subtle depth (cards) |
|
|
80
|
-
| `--shadow-md` | | Moderate elevation (dropdowns) |
|
|
81
|
-
| `--shadow-lg` | | High elevation (modals, popovers) |
|
|
82
|
-
|
|
83
|
-
### Transitions
|
|
84
|
-
|
|
85
|
-
| Token | Value | Use |
|
|
86
|
-
|---|---|---|
|
|
87
|
-
| `--transition-fast` | 150ms ease | Hover states, small elements |
|
|
88
|
-
| `--transition-base` | 200ms ease | Standard transitions |
|
|
89
|
-
| `--transition-slow` | 300ms ease-in-out | Layout changes, modals |
|
|
90
|
-
|
|
91
|
-
---
|
|
92
|
-
|
|
93
|
-
## Layout
|
|
94
|
-
|
|
95
|
-
### Page Structure
|
|
96
|
-
|
|
97
|
-
```
|
|
98
|
-
[Describe or diagram the overall page layout]
|
|
99
|
-
[Include breakpoint behavior]
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
### Grid / Container
|
|
103
|
-
|
|
104
|
-
- Max width: [value]
|
|
105
|
-
- Columns: [count at each breakpoint]
|
|
106
|
-
- Gutter: [value]
|
|
107
|
-
- Margin: [value at each breakpoint]
|
|
108
|
-
|
|
109
|
-
### Breakpoints
|
|
110
|
-
|
|
111
|
-
| Name | Min Width | Layout Changes |
|
|
112
|
-
|---|---|---|
|
|
113
|
-
| Mobile | 0px | [describe] |
|
|
114
|
-
| Tablet | 768px | [describe] |
|
|
115
|
-
| Desktop | 1024px | [describe] |
|
|
116
|
-
| Wide | 1280px | [describe] |
|
|
117
|
-
|
|
118
|
-
---
|
|
119
|
-
|
|
120
|
-
## Components
|
|
121
|
-
|
|
122
|
-
### [Component Name]
|
|
123
|
-
|
|
124
|
-
**Purpose:** [what the component does]
|
|
125
|
-
|
|
126
|
-
**Variants:**
|
|
127
|
-
- [variant 1]: [description]
|
|
128
|
-
- [variant 2]: [description]
|
|
129
|
-
|
|
130
|
-
**States:**
|
|
131
|
-
| State | Visual Treatment |
|
|
132
|
-
|---|---|
|
|
133
|
-
| Default | |
|
|
134
|
-
| Hover | |
|
|
135
|
-
| Focus | |
|
|
136
|
-
| Active | |
|
|
137
|
-
| Disabled | |
|
|
138
|
-
| Loading | |
|
|
139
|
-
| Error | |
|
|
140
|
-
|
|
141
|
-
**Specs:**
|
|
142
|
-
- Height: [value by size]
|
|
143
|
-
- Padding: [values]
|
|
144
|
-
- Font: [size, weight]
|
|
145
|
-
- Border radius: [value]
|
|
146
|
-
- Colors: [token references]
|
|
147
|
-
|
|
148
|
-
---
|
|
149
|
-
|
|
150
|
-
## Interaction Patterns
|
|
151
|
-
|
|
152
|
-
### [Interaction Name]
|
|
153
|
-
|
|
154
|
-
**Trigger:** [click / hover / scroll / load]
|
|
155
|
-
**Behavior:** [describe the interaction]
|
|
156
|
-
**Duration:** [transition timing]
|
|
157
|
-
**Easing:** [easing function]
|
|
158
|
-
|
|
159
|
-
---
|
|
160
|
-
|
|
161
|
-
## Accessibility Notes
|
|
162
|
-
|
|
163
|
-
- [ ] All contrast ratios meet WCAG AA
|
|
164
|
-
- [ ] Focus indicators are visible and styled
|
|
165
|
-
- [ ] Interactive elements have accessible labels
|
|
166
|
-
- [ ] Heading hierarchy is logical
|
|
167
|
-
- [ ] Motion respects `prefers-reduced-motion`
|
|
168
|
-
|
|
169
|
-
---
|
|
170
|
-
|
|
171
|
-
## Implementation Notes
|
|
172
|
-
|
|
173
|
-
[Any technical notes, caveats, or implementation-specific guidance]
|
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
# Component Patterns — UI Interaction Best Practices
|
|
2
|
-
|
|
3
|
-
Reference for designing common UI components with proper states, accessibility, and interaction patterns. Load when designing or reviewing specific components.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Buttons
|
|
8
|
-
|
|
9
|
-
### Hierarchy
|
|
10
|
-
|
|
11
|
-
Every interface needs a clear button hierarchy:
|
|
12
|
-
|
|
13
|
-
| Level | Name | Use Case | Visual Treatment |
|
|
14
|
-
|---|---|---|---|
|
|
15
|
-
| 1 | Primary | Main action per section/page | Filled, brand color, high contrast |
|
|
16
|
-
| 2 | Secondary | Supporting actions | Outlined or muted fill |
|
|
17
|
-
| 3 | Tertiary / Ghost | Low-priority actions, cancel | Text-only or very subtle background |
|
|
18
|
-
| 4 | Destructive | Delete, remove, irreversible | Red/danger color, confirm pattern |
|
|
19
|
-
| 5 | Icon-only | Compact actions (close, menu, edit) | Icon with tooltip, adequate touch target |
|
|
20
|
-
|
|
21
|
-
### Required States
|
|
22
|
-
|
|
23
|
-
Every button must handle:
|
|
24
|
-
- **Default** — Resting state
|
|
25
|
-
- **Hover** — Subtle background/shadow change (desktop)
|
|
26
|
-
- **Focus** — Visible ring/outline for keyboard users (2px offset, contrasting color)
|
|
27
|
-
- **Active/Pressed** — Slightly darker, subtle depression
|
|
28
|
-
- **Disabled** — Reduced opacity (0.5-0.6), no pointer events, `aria-disabled`
|
|
29
|
-
- **Loading** — Spinner or dots replacing text, button disabled during action
|
|
30
|
-
|
|
31
|
-
### Sizing
|
|
32
|
-
|
|
33
|
-
| Size | Height | Padding (x) | Font Size | Use Case |
|
|
34
|
-
|---|---|---|---|---|
|
|
35
|
-
| sm | 32px | 12px | 13-14px | Dense UI, table actions, tag actions |
|
|
36
|
-
| md | 40px | 16px | 14-15px | Standard forms, toolbars |
|
|
37
|
-
| lg | 48px | 24px | 16px | Hero CTAs, mobile-first interfaces |
|
|
38
|
-
|
|
39
|
-
### Accessibility
|
|
40
|
-
- Minimum touch target: 44×44px (even if visual size is smaller, pad the clickable area)
|
|
41
|
-
- Always include accessible label (text content or `aria-label` for icon buttons)
|
|
42
|
-
- Don't rely on color alone — icons or text should reinforce meaning
|
|
43
|
-
|
|
44
|
-
---
|
|
45
|
-
|
|
46
|
-
## Forms
|
|
47
|
-
|
|
48
|
-
### Input Fields
|
|
49
|
-
|
|
50
|
-
**Required states:**
|
|
51
|
-
- Default — Clear border, label above
|
|
52
|
-
- Focus — Highlighted border (brand color), optional subtle shadow
|
|
53
|
-
- Filled — Same as default but with content
|
|
54
|
-
- Error — Red/danger border, error message below, `aria-invalid="true"`
|
|
55
|
-
- Disabled — Muted background, reduced opacity
|
|
56
|
-
- Read-only — No border/minimal border, text appears as content
|
|
57
|
-
|
|
58
|
-
**Layout rules:**
|
|
59
|
-
- Label above input (not beside, not as placeholder)
|
|
60
|
-
- Placeholder text is supplementary, never the only label
|
|
61
|
-
- Error messages appear below the input, in context
|
|
62
|
-
- Help text appears below label or below input, not as tooltip
|
|
63
|
-
- Group related fields (name + email, street + city + state)
|
|
64
|
-
|
|
65
|
-
**Sizing:**
|
|
66
|
-
|
|
67
|
-
| Size | Height | Font Size | Use Case |
|
|
68
|
-
|---|---|---|---|
|
|
69
|
-
| sm | 32px | 13-14px | Dense forms, admin panels |
|
|
70
|
-
| md | 40px | 14-15px | Standard forms |
|
|
71
|
-
| lg | 48px | 16px | Landing pages, mobile |
|
|
72
|
-
|
|
73
|
-
### Select / Dropdown
|
|
74
|
-
|
|
75
|
-
- Show current selection in the trigger
|
|
76
|
-
- Keyboard navigation: arrow keys, type-ahead, Enter to select, Escape to close
|
|
77
|
-
- Long lists: include search/filter
|
|
78
|
-
- Multi-select: use checkboxes inside dropdown, show count or tags in trigger
|
|
79
|
-
|
|
80
|
-
### Checkbox & Radio
|
|
81
|
-
|
|
82
|
-
- Minimum 44×44px touch target (including label)
|
|
83
|
-
- Label always to the right of the indicator
|
|
84
|
-
- Checkbox: independent selections (multi-select)
|
|
85
|
-
- Radio: mutually exclusive within a group
|
|
86
|
-
- Indeterminate checkbox state for "select all" with partial selection
|
|
87
|
-
|
|
88
|
-
### Form Validation
|
|
89
|
-
|
|
90
|
-
- **Inline validation**: Validate on blur (not on every keystroke)
|
|
91
|
-
- **Submit validation**: Validate all fields, focus the first error, scroll if needed
|
|
92
|
-
- **Error messaging**: Specific ("Email must include @") not generic ("Invalid input")
|
|
93
|
-
- **Success feedback**: Brief confirmation, then move on — don't celebrate trivial actions
|
|
94
|
-
|
|
95
|
-
---
|
|
96
|
-
|
|
97
|
-
## Cards
|
|
98
|
-
|
|
99
|
-
### When to Use
|
|
100
|
-
- Displaying a collection of items with mixed content (image + text + actions)
|
|
101
|
-
- Content that can be browsed and compared
|
|
102
|
-
- NOT for single content blocks or sequential content (use sections instead)
|
|
103
|
-
|
|
104
|
-
### Anatomy
|
|
105
|
-
1. **Media area** (optional) — Image, video, or illustration at top or left
|
|
106
|
-
2. **Header** — Title, subtitle, metadata
|
|
107
|
-
3. **Body** — Description or summary content
|
|
108
|
-
4. **Footer** (optional) — Actions, tags, or secondary metadata
|
|
109
|
-
|
|
110
|
-
### Interaction Patterns
|
|
111
|
-
- **Clickable card**: Entire card is a link, hover shows elevation change
|
|
112
|
-
- **Card with actions**: Card is not clickable, specific buttons/links inside are
|
|
113
|
-
- **Never both**: Don't make the whole card clickable AND have buttons inside it
|
|
114
|
-
|
|
115
|
-
### States
|
|
116
|
-
- Default, Hover (if clickable), Selected (in a selection context), Loading (skeleton)
|
|
117
|
-
|
|
118
|
-
---
|
|
119
|
-
|
|
120
|
-
## Navigation
|
|
121
|
-
|
|
122
|
-
### Top Navigation (Navbar)
|
|
123
|
-
|
|
124
|
-
- Logo/brand on the left
|
|
125
|
-
- Primary nav items horizontally centered or right-aligned
|
|
126
|
-
- Active page indicator: bold text, underline, or background highlight
|
|
127
|
-
- Mobile: hamburger menu (3 lines) → slide-out or full-screen overlay
|
|
128
|
-
- Sticky/fixed: include subtle shadow or border when scrolled
|
|
129
|
-
- Max 5-7 primary items; overflow into "More" dropdown
|
|
130
|
-
|
|
131
|
-
### Sidebar Navigation
|
|
132
|
-
|
|
133
|
-
- Collapsible for more content space
|
|
134
|
-
- Active item: filled background with brand color, or left border accent
|
|
135
|
-
- Group items with section headers
|
|
136
|
-
- Icons + labels in expanded state, icons-only in collapsed state with tooltips
|
|
137
|
-
- Scroll independently from main content
|
|
138
|
-
|
|
139
|
-
### Breadcrumbs
|
|
140
|
-
|
|
141
|
-
- Show current location in hierarchy
|
|
142
|
-
- Each segment is a link except the current page
|
|
143
|
-
- Separator: `/` or `>` or chevron icon
|
|
144
|
-
- Truncate long paths: show first, `...`, last 2 segments
|
|
145
|
-
|
|
146
|
-
### Tabs
|
|
147
|
-
|
|
148
|
-
- Horizontal for 2-5 options, vertical for 5+ or when labels are long
|
|
149
|
-
- Active tab: bold/colored text + bottom border (horizontal) or left border (vertical)
|
|
150
|
-
- Tab content switches without page reload
|
|
151
|
-
- Keyboard: arrow keys to switch, Tab to enter content area
|
|
152
|
-
- Don't nest tabs within tabs
|
|
153
|
-
|
|
154
|
-
---
|
|
155
|
-
|
|
156
|
-
## Modals & Dialogs
|
|
157
|
-
|
|
158
|
-
### When to Use
|
|
159
|
-
- Confirming destructive actions
|
|
160
|
-
- Short forms that don't warrant a new page (login, quick edit)
|
|
161
|
-
- Displaying focused content that blocks the main flow
|
|
162
|
-
|
|
163
|
-
### When NOT to Use
|
|
164
|
-
- Displaying information that could be inline
|
|
165
|
-
- Long forms or multi-step flows (use a page instead)
|
|
166
|
-
- Welcome messages or tutorials (use onboarding flows)
|
|
167
|
-
|
|
168
|
-
### Anatomy
|
|
169
|
-
- **Overlay/backdrop**: Semi-transparent dark (rgba(0,0,0,0.4-0.6))
|
|
170
|
-
- **Container**: Centered, max-width 480-640px, adequate padding (24-32px)
|
|
171
|
-
- **Header**: Title + close button (X) in top-right
|
|
172
|
-
- **Body**: Content area, scrollable if content overflows
|
|
173
|
-
- **Footer**: Action buttons (primary right, cancel left)
|
|
174
|
-
|
|
175
|
-
### Interaction
|
|
176
|
-
- Escape key closes the modal
|
|
177
|
-
- Clicking backdrop closes (for non-critical modals) or doesn't (for confirmations)
|
|
178
|
-
- Focus trapped inside modal (Tab cycles through modal elements only)
|
|
179
|
-
- Return focus to trigger element on close
|
|
180
|
-
- Prevent body scroll while modal is open
|
|
181
|
-
|
|
182
|
-
---
|
|
183
|
-
|
|
184
|
-
## Tables
|
|
185
|
-
|
|
186
|
-
### Best Practices
|
|
187
|
-
- Align text left, numbers right
|
|
188
|
-
- Header row: bold, subtle background, sticky on scroll
|
|
189
|
-
- Zebra striping OR subtle horizontal borders (not both)
|
|
190
|
-
- Minimum row height: 48px for touch, 36px for dense desktop
|
|
191
|
-
- Sortable columns: show sort indicator (arrow up/down)
|
|
192
|
-
- Pagination or virtual scroll for large datasets
|
|
193
|
-
|
|
194
|
-
### Responsive
|
|
195
|
-
- Priority columns stay visible, secondary columns hide on mobile
|
|
196
|
-
- Alternative: card-based layout on mobile instead of table
|
|
197
|
-
- Horizontal scroll as a last resort (wrap in a scroll container with shadow indicators)
|
|
198
|
-
|
|
199
|
-
---
|
|
200
|
-
|
|
201
|
-
## Feedback & Status
|
|
202
|
-
|
|
203
|
-
### Toast / Snackbar
|
|
204
|
-
- Brief messages (1-2 lines), auto-dismiss after 4-6 seconds
|
|
205
|
-
- Position: bottom-center or top-right
|
|
206
|
-
- Types: success (green), error (red), warning (amber), info (blue/neutral)
|
|
207
|
-
- Include dismiss action and optional undo for destructive actions
|
|
208
|
-
- Stack new toasts, don't replace existing ones
|
|
209
|
-
|
|
210
|
-
### Empty States
|
|
211
|
-
- Illustration or icon (purposeful, not decorative)
|
|
212
|
-
- Clear headline: what this area is for
|
|
213
|
-
- Description: why it's empty
|
|
214
|
-
- CTA: how to populate it
|
|
215
|
-
- Don't just show a blank white space
|
|
216
|
-
|
|
217
|
-
### Loading States
|
|
218
|
-
- **Skeleton screens** (preferred): Gray placeholder shapes matching content layout
|
|
219
|
-
- **Spinner**: Only for short, indeterminate waits (< 3 seconds expected)
|
|
220
|
-
- **Progress bar**: For determinate operations with known duration
|
|
221
|
-
- **Inline loading**: Button spinner, input loading indicator
|
|
222
|
-
|
|
223
|
-
### Error States
|
|
224
|
-
- Page-level: Friendly message + illustration, retry button, link to support
|
|
225
|
-
- Inline: Red border, error text below the field, `aria-invalid`
|
|
226
|
-
- Network: "Something went wrong" with retry, not a technical error dump
|
|
227
|
-
- 404: Helpful redirect suggestions, search, home link
|
|
228
|
-
|
|
229
|
-
---
|
|
230
|
-
|
|
231
|
-
## Accessibility Essentials
|
|
232
|
-
|
|
233
|
-
### Color & Contrast
|
|
234
|
-
- Body text: 4.5:1 contrast ratio minimum (WCAG AA)
|
|
235
|
-
- Large text (18px+ or 14px+ bold): 3:1 minimum
|
|
236
|
-
- Interactive elements: 3:1 against adjacent colors
|
|
237
|
-
- Don't use color as the only indicator — pair with icons, text, or patterns
|
|
238
|
-
|
|
239
|
-
### Keyboard Navigation
|
|
240
|
-
- All interactive elements focusable via Tab
|
|
241
|
-
- Visible focus indicator (not just browser default — design a custom one)
|
|
242
|
-
- Logical tab order matching visual layout
|
|
243
|
-
- Escape closes overlays, Enter activates buttons/links
|
|
244
|
-
|
|
245
|
-
### Screen Readers
|
|
246
|
-
- Meaningful alt text for informational images
|
|
247
|
-
- Empty alt (`alt=""`) for decorative images
|
|
248
|
-
- Proper heading hierarchy (h1 → h2 → h3, no skipping)
|
|
249
|
-
- ARIA labels for icon-only buttons and complex widgets
|
|
250
|
-
- Live regions for dynamic content updates (toast notifications, form errors)
|
|
251
|
-
|
|
252
|
-
### Motion
|
|
253
|
-
- Respect `prefers-reduced-motion` — disable or simplify animations
|
|
254
|
-
- No auto-playing video or audio without user control
|
|
255
|
-
- Avoid rapid flashing (3 flashes per second max)
|