|
| 1 | +--- |
| 2 | +name: igniteui-from-design |
| 3 | +description: > |
| 4 | + Implement Angular application views from design images using Ignite UI Angular components. |
| 5 | + Uses MCP servers (igniteui, igniteui-theming, angular-cli) to discover components, generate |
| 6 | + themes, and follow best practices. Triggers when the user provides a design image (screenshot, |
| 7 | + mockup, wireframe) and wants it built as a working Angular view with igniteui-angular components. |
| 8 | + Also triggers when the user asks to "implement this design", "build this UI", "convert this |
| 9 | + mockup", or "create a page from this image" in an Ignite UI Angular project. |
| 10 | +--- |
| 11 | + |
| 12 | +# Implementing Ignite UI Angular Views from Design Images |
| 13 | + |
| 14 | +## Workflow |
| 15 | + |
| 16 | +1. **Analyze the design image** - Read the image, identify every UI section, component, layout structure, colors, and data patterns |
| 17 | +2. **Detect platform** - Call `mcp__igniteui-theming__detect_platform` to confirm Angular + licensed status |
| 18 | +3. **Discover components** - Call `mcp__igniteui__list_components` with targeted filters to find matching components for each UI pattern |
| 19 | +4. **Look up component docs** - Call `mcp__igniteui__get_doc` for unfamiliar components to learn their API |
| 20 | +5. **Get best practices** - Call `mcp__angular-cli__get_best_practices` with the workspace path |
| 21 | +6. **Generate theme** - Call `mcp__igniteui-theming__create_theme` (or `create_palette`) with colors extracted from the design |
| 22 | +7. **Install packages** - Install any additional DV packages needed (charts, maps, gauges) |
| 23 | +8. **Implement** - Build the app shell, data layer, and view components |
| 24 | +9. **Iterate** - Compare output vs design image, fix visual differences |
| 25 | + |
| 26 | +## Step 1: Analyze the Design Image |
| 27 | + |
| 28 | +Read the input image carefully. For each visual section, identify: |
| 29 | + |
| 30 | +- **Layout structure**: grid rows/columns, sidebar, navbar, content area proportions |
| 31 | +- **Component type**: chart, list, card, map, gauge, table, form, etc. |
| 32 | +- **Color palette**: primary, secondary, surface/background, accent, text colors |
| 33 | +- **Typography**: font sizes, weights, letter-spacing patterns |
| 34 | +- **Data patterns**: what mock data is needed (time series, lists, KPIs, geographic) |
| 35 | + |
| 36 | +## Step 2-3: Use MCP Tools for Discovery |
| 37 | + |
| 38 | +Call `mcp__igniteui-theming__detect_platform` first to confirm the project setup. |
| 39 | + |
| 40 | +Then call `mcp__igniteui__list_components` with `framework: "angular"` and relevant filters to find components matching each UI pattern. Common filters: |
| 41 | + |
| 42 | +- `chart`, `sparkline` - for data visualization |
| 43 | +- `list`, `card`, `avatar`, `badge` - for data display |
| 44 | +- `nav`, `navbar`, `drawer` - for navigation |
| 45 | +- `progress`, `gauge` - for metrics |
| 46 | +- `map` - for geographic displays |
| 47 | +- `grid` - for tabular data |
| 48 | + |
| 49 | +For component-to-Ignite-UI mapping, see [references/component-mapping.md](references/component-mapping.md). |
| 50 | + |
| 51 | +## Step 4: Look Up Component API |
| 52 | + |
| 53 | +For any component you haven't used before, call `mcp__igniteui__get_doc` with the doc name from `list_components` results (e.g., `name: "card"`, `framework: "angular"`). This gives exact usage patterns, inputs, and template structure. |
| 54 | + |
| 55 | +Call `mcp__igniteui__search_docs` for feature-based questions (e.g., "how to style area chart dark theme"). |
| 56 | + |
| 57 | +## Step 5: Generate Theme with MCP |
| 58 | + |
| 59 | +Extract colors from the design image, then call: |
| 60 | + |
| 61 | +``` |
| 62 | +mcp__igniteui-theming__create_theme({ |
| 63 | + primaryColor: "<extracted primary>", |
| 64 | + secondaryColor: "<extracted secondary>", |
| 65 | + surfaceColor: "<extracted background>", |
| 66 | + variant: "dark" or "light", |
| 67 | + platform: "angular", |
| 68 | + licensed: true/false, |
| 69 | + fontFamily: "<extracted font>", |
| 70 | + designSystem: "material" |
| 71 | +}) |
| 72 | +``` |
| 73 | + |
| 74 | +Use `create_palette` instead if only the palette needs customization. Use `create_component_theme` for per-component overrides (navbar, drawer, list backgrounds). |
| 75 | + |
| 76 | +## Step 6: Install DV Packages |
| 77 | + |
| 78 | +Core UI components ship with `@infragistics/igniteui-angular`. Charts, maps, gauges, and sparklines require additional packages. See [references/component-mapping.md](references/component-mapping.md) for package names and import patterns. |
| 79 | + |
| 80 | +## Step 7: Implement |
| 81 | + |
| 82 | +### Structure |
| 83 | + |
| 84 | +- **App shell**: navbar + nav drawer + router-outlet in root component |
| 85 | +- **Data layer**: interfaces in `models/`, injectable service with mock data in `services/` |
| 86 | +- **View**: CSS Grid layout with panel sections in the routed component |
| 87 | + |
| 88 | +### Key Implementation Rules |
| 89 | + |
| 90 | +- Use Angular project conventions from `CLAUDE.md` / `AGENTS.md` (standalone components, OnPush, signals, `@if`/`@for`, `inject()`) |
| 91 | +- Set all DV component colors explicitly via inputs — they do NOT inherit the Sass theme |
| 92 | +- For dark themes, use `$dark-material-schema` and define CSS custom properties for panel styling |
| 93 | +- Use `::ng-deep` with component theme mixins (`navbar-theme`, `navdrawer-theme`, `list-theme`) for core UI dark styling |
| 94 | + |
| 95 | +### Common Pitfalls |
| 96 | + |
| 97 | +Consult [references/gotchas.md](references/gotchas.md) for known issues including: |
| 98 | +- Sass function name collisions (`contrast()`) |
| 99 | +- Font family syntax in typography mixin |
| 100 | +- Chart marker visibility, missing properties |
| 101 | +- Avatar/component property mismatches |
| 102 | +- Map dark styling and programmatic series setup |
| 103 | + |
| 104 | +## Step 8: Iterate on Visual Fidelity |
| 105 | + |
| 106 | +After the first build, compare the output screenshot against the original design. Common fixes: |
| 107 | + |
| 108 | +- **Chart too spiky**: increase data points (300-500), use exponential smoothing, set `[markerTypes]="'none'"` |
| 109 | +- **Map too dark/light**: adjust CSS filter values (`grayscale`, `brightness`, `saturate`) |
| 110 | +- **Panel proportions wrong**: adjust CSS Grid `grid-template-columns` ratios |
| 111 | +- **Missing content sections**: re-examine the original design for overlooked elements |
| 112 | +- **Nav drawer in wrong mode**: remove `igxDrawerMini` template if full mode is needed, or vice versa |
| 113 | + |
| 114 | +Rebuild, take a new screenshot, and compare again until satisfied. |
0 commit comments