Skip to content

Commit beb5e75

Browse files
refactor(blazor): update layout and navigation documentation for clarity and accuracy
1 parent 98234f7 commit beb5e75

3 files changed

Lines changed: 64 additions & 32 deletions

File tree

  • packages/cli/templates/blazor/igb/projects/ai-config/files/skills

packages/cli/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/layout.md

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,7 @@ This reference gives high-level guidance on layout and navigation components, th
2323
> **Docs:** [Tabs](https://www.infragistics.com/products/ignite-ui-blazor/blazor/components/layouts/tabs)
2424
2525
```csharp
26-
builder.Services.AddIgniteUIBlazor(typeof(IgbTabsModule), typeof(IgbTabModule));
27-
```
28-
29-
```razor
30-
<IgbTabs>
31-
<IgbTab Panel="home">Home</IgbTab>
32-
<IgbTab Panel="search">Search</IgbTab>
33-
<IgbTab Panel="favorites" Disabled="true">Favorites</IgbTab>
34-
<IgbTabPanel Id="home">Home panel content</IgbTabPanel>
35-
<IgbTabPanel Id="search">Search panel content</IgbTabPanel>
36-
<IgbTabPanel Id="favorites">Favorites panel content</IgbTabPanel>
37-
</IgbTabs>
26+
builder.Services.AddIgniteUIBlazor(typeof(IgbTabsModule));
3827
```
3928

4029
For icon tabs, use the `label` slot inside `IgbTab`:
@@ -46,7 +35,7 @@ For icon tabs, use the `label` slot inside `IgbTab`:
4635
</IgbTab>
4736
```
4837

49-
Key attributes on `IgbTabs`: `Alignment` (`TabsAlignment.Start` / `End` / `Center` / `Justify`), `Activation` (`TabsActivation.Auto` / `Manual`). On `IgbTab`: `Panel` (must match `IgbTabPanel.Id`), `Disabled`, `Selected`.
38+
Key attributes on `IgbTabs`: `Alignment` (`TabsAlignment.Start` / `End` / `Center` / `Justify`), `Activation` (`TabsActivation.Auto` / `Manual`). On `IgbTab`: `Label`, `Disabled`, `Selected`.
5039

5140
Events on `IgbTabs`: `Change` - fires when the selected tab changes.
5241

@@ -311,8 +300,7 @@ Events on `IgbTree`: `NodeSelectionChanging` (cancellable), `NodeSelectionChange
311300

312301
## Key Rules
313302

314-
1. **`IgbTab.Panel` must match `IgbTabPanel.Id`** - mismatched IDs cause the panel to never display.
315-
2. **Stepper with `Linear="true"` prevents users from skipping steps.** Do not set `Linear` if free navigation is intended.
316-
3. **Activate/deactivate `IgbNavDrawerItem` programmatically** by setting `item.Active` - there is no automatic selection tracking.
317-
4. **Register icons via `RegisterIconFromTextAsync` in `OnAfterRenderAsync(bool firstRender)`**, and always call `await component.EnsureReady()` first.
318-
5. **`IgbAccordion` with `SingleExpand="true"` closes other panels when one is opened.** This is the most common use case for accordions.
303+
1. **Stepper with `Linear="true"` prevents users from skipping steps.** Do not set `Linear` if free navigation is intended.
304+
2. **Activate/deactivate `IgbNavDrawerItem` programmatically** by setting `item.Active` - there is no automatic selection tracking.
305+
3. **Register icons via `RegisterIconFromTextAsync` in `OnAfterRenderAsync(bool firstRender)`**, and always call `await component.EnsureReady()` first.
306+
4. **`IgbAccordion` with `SingleExpand="true"` closes other panels when one is opened.** This is the most common use case for accordions.

packages/cli/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-generate-from-image-design/SKILL.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ user-invocable: true
1111
Before writing any implementation code, you must complete these steps in order:
1212

1313
1. Analyze the image and identify all visible regions and UI patterns.
14-
2. Read [references/component-mapping.md](references/component-mapping.md) and [references/gotchas.md](references/gotchas.md).
14+
2. Read [references/component-mapping.md](references/component-mapping.md).
1515
3. This skill is Blazor-only. Check NuGet package (`IgniteUI.Blazor.Lite`, `IgniteUI.Blazor.GridLite` for general purpose components and light-weight grid, or `IgniteUI.Blazor` / `IgniteUI.Blazor.Trial` for specialized feature-rich grids and charts) only when theming or component availability depends on it.
1616
4. To apply a theme, use the theming workflow from this skill and the dedicated `igniteui-blazor-theming` skill; use the `igniteui-theming` MCP tools instead of styling from memory.
1717
5. Call `get_doc` for every chosen component family before using it.
18-
6. Only then start coding.
18+
6. **Read [references/gotchas.md](references/gotchas.md) now — after docs, before writing any code.** Read the file in full. Some entries are component-specific; others apply broadly to any chart, any themed component, or any scoped CSS. Apply every entry that is relevant to what you are building. This is a blocking step: do not start implementation until you have read the whole file and checked it against your component list.
19+
7. Only then start coding.
1920

2021
---
2122

@@ -25,7 +26,7 @@ Before writing any implementation code, you must complete these steps in order:
2526
2. **Confirm NuGet package if needed** - this skill is Blazor-only; use `IgniteUI.Blazor.Lite`, `IgniteUI.Blazor.GridLite` for general purpose components and the light-weight grid, and `IgniteUI.Blazor` (trial version available publicly as `IgniteUI.Blazor.Trial`) for specialized feature-rich grids and charts.
2627
3. **Discover components** - Call `list_components` with targeted filters and `framework: "blazor"` to find matching components for each UI pattern.
2728
4. **Look up component docs** - Call `get_doc` for every chosen component family before coding.
28-
5. **Generate theme** - (a) To generate a theme, first extract colors and create a color palette using `create_palette` or `create_custom_palette` depending on the scenario. Then extract elevations and call `create_elevations`. Then extract typography and call `create_typography`. Then call `create_theme` with the palette, elevations, and typography with `platform: "blazor"`. (b) After a palette exists, prefer using design tokens or scoped semantic CSS variables over raw literals. (c) For every Ignite UI component, call `get_component_design_tokens`, map extracted image tokens to token roles, then call `create_component_theme` with the tokens differing from the global theme for the specific component.
29+
5. **Generate theme** - (a) Extract colors and call `create_palette` or `create_custom_palette` with `platform: "blazor"` and `output: "css"` — do **not** use `create_theme` for Blazor, it produces Sass requiring compilation. Optionally call `create_elevations` and `create_typography` for elevation and font overrides. (b) After a palette exists, prefer using design tokens or scoped semantic CSS variables over raw literals. (c) For every Ignite UI component, call `get_component_design_tokens`, map extracted image tokens to token roles, then call `create_component_theme` with the tokens differing from the global theme for the specific component.
2930
6. **Implement** - Build the screenshot-first layout, data, and view components.
3031
7. **Refine** - Use the `set_size`, `set_spacing`, `set_roundness` tools to refine the view's visual fidelity against the image, then iterate on implementation and theming until the view matches the design closely.
3132
8. **Validate** - Build, test, run, compare against the image, and fix differences.
@@ -236,7 +237,7 @@ If the required NuGet package is not referenced in the project, identify the cor
236237
### Implementation Checks
237238

238239
- Use [references/component-mapping.md](references/component-mapping.md) for component-choice and semantic-fallback rules
239-
- Use [references/gotchas.md](references/gotchas.md) for components, theming, and API edge cases instead of re-encoding those rules inline
240+
- When unsure about an API parameter, CSS scoping rule, or component choice, re-check [references/gotchas.md](references/gotchas.md) — do not guess or re-encode its rules inline
240241
- Favor Ignite UI components over custom HTML when both approaches can reach similar visual fidelity
241242
- Preserve spacing, hierarchy, and data density before adding extra interactivity
242243
- Avoid generic placeholders when the image shows domain-specific content

packages/cli/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-generate-from-image-design/references/gotchas.md

Lines changed: 53 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,27 @@ Brushes="#FF6B6B #4ECDC4 #45B7D1"
9494
### `AreaFillOpacity` exists on `IgbCategoryChart`
9595
It does **NOT** exist on `IgbSparkline`. For sparkline fill, use the `Brush` parameter.
9696

97+
### `IgbSparkline` has no SplineArea type — use `IgbCategoryChart` for smooth area sparklines
98+
`IgbSparkline` supports only `Line`, `Area`, `Column`, and `WinLoss` display types. `Area` renders as angular polygon fills, not smooth curves. If the design shows smooth mountain-shaped area sparklines, use a small `IgbCategoryChart` with `ChartType="CategoryChartType.SplineArea"`:
99+
100+
```razor
101+
<!-- ❌ Angular fill — no smooth curves available on IgbSparkline -->
102+
<IgbSparkline DisplayType="SparklineDisplayType.Area" Brush="#5B57E8" ... />
103+
104+
<!-- ✅ Smooth spline area sparkline -->
105+
<IgbCategoryChart @ref="splineChart"
106+
ChartType="@CategoryChartType.SplineArea"
107+
Brushes="#5B57E8"
108+
Outlines="#5B57E8"
109+
AreaFillOpacity="0.35"
110+
XAxisLabelTextColor="transparent"
111+
YAxisLabelTextColor="transparent"
112+
Height="70px"
113+
Width="100%"
114+
DataSource="@SparkData" />
115+
```
116+
117+
97118
### `IncludedProperties` and `ExcludedProperties` are string arrays
98119
Pass them as bound parameters:
99120
```razor
@@ -132,7 +153,38 @@ jobSeries.Brushes = "#CF6E7A #6C74DC #D4A84B";
132153
```
133154

134155
### Smooth area/line charts
135-
Set `ChartType` to `Spline`, `SplineArea`, or `StepLine` / `StepArea` depending on the visual in the screenshot.
156+
Match `ChartType` to the curve shape in the screenshot:
157+
- Smooth flowing curves → `Spline` (lines) or `SplineArea` (filled)
158+
- Angular/jagged lines → `Line` or `Area`
159+
- Step-shaped → `StepLine` or `StepArea`
160+
161+
Do not default to `Line` or `Area` when the screenshot shows smooth curves. The difference is immediately visible and is the most common chart fidelity mistake.
162+
163+
### Circular ring with centered percentage — choosing the right component
164+
- **Thick static ring with a centred label and no needle**`IgbDoughnutChart` + `IgbRingSeries`. Place `InnerExtent` on the chart, not the series. Overlay the label with `position: absolute` inside a `position: relative` wrapper.
165+
- **Thin animated spinner / loading progress**`IgbCircularProgress`. Not a data visualisation.
166+
- **Needle pointer on a scale arc**`IgbRadialGauge`.
167+
168+
`IgbRadialGauge` and `IgbCircularProgress` will never produce a clean static ring. Use `IgbDoughnutChart` whenever the design shows a coloured arc ring with a centred value and no needle.
169+
170+
```razor
171+
<div class="gauge-wrapper">
172+
<IgbDoughnutChart InnerExtent="0.62" Height="160px" Width="160px" AllowSliceExplosion="false">
173+
<IgbRingSeries ValueMemberPath="Value" LabelMemberPath="Category"
174+
LabelsPosition="@LabelsPosition.None"
175+
DataSource="@GaugeData"
176+
Brushes="#5B57E8 #e8e8f5"
177+
Outlines="transparent transparent"
178+
RadiusFactor="0.95" />
179+
</IgbDoughnutChart>
180+
<div class="gauge-label">75%</div>
181+
</div>
182+
```
183+
184+
```css
185+
.gauge-wrapper { position: relative; display: inline-flex; align-items: center; justify-content: center; }
186+
.gauge-label { position: absolute; font-size: 1.9rem; font-weight: 700; }
187+
```
136188

137189
### Charts inside CSS Grid can collapse
138190
Charts may render with zero height inside a CSS Grid container. Set `min-height: 0` on the grid cell and `Height="100%"` on the chart component so the chart fills its container without requiring a fixed pixel value:
@@ -184,15 +236,6 @@ The component's `::part(base)` is always `position: fixed; transform: translateX
184236

185237
To make the drawer occupy real layout space (pinned sidebar), override the parts in **global CSS**: set explicit width on the host, `position: relative; transform: none` on `::part(base)`, hide `::part(overlay)`, and strip `inert` from `::part(base)` via JS in `OnAfterRenderAsync`. See `layout.md` for the full pattern.
186238

187-
### IgbTabs: Panel and Id pairing
188-
Each `IgbTab` must reference an `IgbTabPanel` via the `Panel` property matching the panel's `Id`:
189-
```razor
190-
<IgbTabs>
191-
<IgbTab Panel="panel-1">Tab A</IgbTab>
192-
<IgbTabPanel Id="panel-1">Content A</IgbTabPanel>
193-
</IgbTabs>
194-
```
195-
196239
### IgbTileManager: drag and resize modes
197240
Set `DragMode` and `ResizeMode` for interactive dashboards:
198241
```razor

0 commit comments

Comments
 (0)