igniteui-cli 15.5.1 → 15.6.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 (78) hide show
  1. package/package.json +4 -4
  2. package/templates/blazor/igb/projects/ai-config/files/skills/AGENTS.md +6 -3
  3. package/templates/blazor/igb/projects/ai-config/files/skills/README.md +30 -45
  4. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/SKILL.md +48 -96
  5. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/charts.md +61 -238
  6. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/data-display.md +60 -193
  7. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/feedback.md +36 -92
  8. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/form-controls.md +66 -224
  9. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/layout-manager.md +39 -88
  10. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/layout.md +75 -152
  11. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/setup.md +40 -149
  12. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-generate-from-image-design/SKILL.md +58 -243
  13. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-generate-from-image-design/references/component-mapping.md +89 -280
  14. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-generate-from-image-design/references/gotchas.md +143 -431
  15. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/SKILL.md +91 -157
  16. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/data-operations.md +50 -228
  17. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/editing.md +61 -222
  18. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/features.md +67 -360
  19. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/grid-migration.md +55 -236
  20. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/paging-remote.md +53 -202
  21. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/sizing.md +31 -232
  22. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/state.md +27 -119
  23. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/structure.md +88 -363
  24. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/types.md +87 -415
  25. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-lite-testing/SKILL.md +8 -4
  26. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-lite-testing/references/interop-contracts.md +42 -6
  27. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-theming/SKILL.md +83 -211
  28. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-theming/references/common-patterns.md +93 -184
  29. package/templates/react/igr-ts/avatar/default/files/src/app/__path__/__filePrefix__.tsx +3 -3
  30. package/templates/react/igr-ts/avatar/default/files/src/app/__path__/style.module.css +9 -0
  31. package/templates/react/igr-ts/button/default/files/src/app/__path__/__filePrefix__.tsx +1 -1
  32. package/templates/react/igr-ts/button/default/files/src/app/__path__/style.module.css +3 -0
  33. package/templates/react/igr-ts/icon/default/files/src/app/__path__/__filePrefix__.tsx +2 -2
  34. package/templates/react/igr-ts/icon/default/files/src/app/__path__/style.module.css +3 -0
  35. package/templates/react/igr-ts/icon-button/default/files/src/app/__path__/__filePrefix__.tsx +1 -1
  36. package/templates/react/igr-ts/icon-button/default/files/src/app/__path__/style.module.css +3 -0
  37. package/templates/react/igr-ts/pivot-grid/basic/files/src/app/__path__/__filePrefix__.tsx +3 -4
  38. package/templates/react/igr-ts/projects/_base/files/package.json +1 -0
  39. package/templates/react/igr-ts/projects/ai-config/files/skills/README.md +30 -83
  40. package/templates/react/igr-ts/projects/ai-config/files/skills/grid-lite-to-igr-grid-migration/SKILL.md +98 -191
  41. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/SKILL.md +38 -147
  42. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/COMPONENTS.md +65 -0
  43. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/DATAVIZ.md +90 -0
  44. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/MCP.md +43 -0
  45. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/TROUBLESHOOTING.md +17 -145
  46. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/USAGE.md +85 -0
  47. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-customize-theme/SKILL.md +83 -135
  48. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-customize-theme/reference/CSS-THEMING.md +51 -218
  49. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-generate-from-image-design/SKILL.md +58 -187
  50. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-generate-from-image-design/reference/gotchas.md +55 -154
  51. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-optimize-bundle-size/SKILL.md +48 -401
  52. package/templates/webcomponents/igc-ts/avatar/default/files/src/app/__path__/__filePrefix__.ts +7 -2
  53. package/templates/webcomponents/igc-ts/button/default/files/src/app/__path__/__filePrefix__.ts +8 -3
  54. package/templates/webcomponents/igc-ts/card/default/files/src/app/__path__/__filePrefix__.ts +3 -1
  55. package/templates/webcomponents/igc-ts/constants.d.ts +5 -5
  56. package/templates/webcomponents/igc-ts/constants.js +5 -5
  57. package/templates/webcomponents/igc-ts/date-time-input/default/files/src/app/__path__/__filePrefix__.ts +8 -2
  58. package/templates/webcomponents/igc-ts/icon/default/files/src/app/__path__/__filePrefix__.ts +7 -3
  59. package/templates/webcomponents/igc-ts/icon-button/default/files/src/app/__path__/__filePrefix__.ts +8 -2
  60. package/templates/webcomponents/igc-ts/projects/_base/files/package.json +1 -1
  61. package/templates/webcomponents/igc-ts/projects/_base_with_home/files/package.json +6 -6
  62. package/templates/webcomponents/igc-ts/projects/ai-config/files/skills/README.md +1 -0
  63. package/templates/webcomponents/igc-ts/projects/side-nav-auth/files/src/app/authentication/login-bar/login-bar.ts +1 -1
  64. package/templates/webcomponents/igc-ts/tabs/default/files/src/app/__path__/__filePrefix__.ts +21 -15
  65. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-components/references/mcp-setup.md +0 -78
  66. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-grids/references/mcp-setup.md +0 -78
  67. package/templates/blazor/igb/projects/ai-config/files/skills/igniteui-blazor-theming/references/mcp-setup.md +0 -81
  68. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/CHARTS-GRIDS.md +0 -398
  69. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/COMPONENT-CATALOGUE.md +0 -161
  70. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/EVENT-HANDLING.md +0 -72
  71. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/INSTALLATION.md +0 -139
  72. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/JSX-PATTERNS.md +0 -187
  73. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/MCP-SERVER.md +0 -77
  74. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-components/reference/REFS-FORMS.md +0 -232
  75. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-customize-theme/reference/MCP-SERVER.md +0 -67
  76. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-customize-theme/reference/TROUBLESHOOTING.md +0 -35
  77. package/templates/react/igr-ts/projects/ai-config/files/skills/igniteui-react-generate-from-image-design/reference/component-mapping.md +0 -132
  78. /package/templates/webcomponents/igc-ts/tabs/default/files/src/app/__path__/{__filePrefix__.test → __filePrefix__.test.ts} +0 -0
@@ -1,139 +0,0 @@
1
- # Installation & Setup
2
-
3
- ## Install the Package
4
-
5
- ```bash
6
- # Core UI components (MIT)
7
- npm install igniteui-react
8
-
9
- # If you need the lightweight grid (MIT)
10
- # Requires BOTH packages - igniteui-react and igniteui-grid-lite
11
- npm install igniteui-react igniteui-grid-lite
12
-
13
- # If you need advanced grids (commercial)
14
- npm install igniteui-react-grids
15
-
16
- # If you need charts (commercial)
17
- npm install igniteui-react-charts
18
-
19
- # If you need gauges (commercial)
20
- npm install igniteui-react-gauges
21
-
22
- # If you need maps (commercial)
23
- npm install igniteui-react-maps
24
- ```
25
-
26
- ## Peer Dependencies
27
-
28
- `igniteui-react` requires `react` and `react-dom` (v18+ or v19+). These are typically already in your project:
29
-
30
- ```bash
31
- npm install react react-dom
32
- ```
33
-
34
- ## Import a Theme (REQUIRED)
35
-
36
- > **CRITICAL:** Components will render without styles, with broken icons and missing visuals if the theme CSS is not imported. **Always import the theme CSS before using any Ignite UI component.**
37
-
38
- Import one theme CSS file in your entry point (`main.tsx`, `index.tsx`, or `App.tsx`). The theme CSS must be imported **in every file that uses Ignite UI components** if your framework does not have a single global entry point (e.g., Next.js — see below).
39
-
40
- ```tsx
41
- // main.tsx or index.tsx
42
- import 'igniteui-webcomponents/themes/light/bootstrap.css';
43
- ```
44
-
45
- Available themes:
46
-
47
- | Import | Theme |
48
- |---|---|
49
- | `igniteui-webcomponents/themes/light/bootstrap.css` | Bootstrap Light |
50
- | `igniteui-webcomponents/themes/dark/bootstrap.css` | Bootstrap Dark |
51
- | `igniteui-webcomponents/themes/light/material.css` | Material Light |
52
- | `igniteui-webcomponents/themes/dark/material.css` | Material Dark |
53
- | `igniteui-webcomponents/themes/light/fluent.css` | Fluent Light |
54
- | `igniteui-webcomponents/themes/dark/fluent.css` | Fluent Dark |
55
- | `igniteui-webcomponents/themes/light/indigo.css` | Indigo Light |
56
- | `igniteui-webcomponents/themes/dark/indigo.css` | Indigo Dark |
57
-
58
- Grid theme CSS files follow the same pattern under `igniteui-react-grids/grids/themes/`.
59
-
60
- **For grids**, you **must also** import the grid theme CSS. Without it, the grid will be missing styles and icons will show as placeholders:
61
-
62
- ```tsx
63
- import 'igniteui-webcomponents/themes/light/bootstrap.css';
64
- import 'igniteui-react-grids/grids/themes/light/bootstrap.css';
65
- ```
66
-
67
- ## Next.js Setup
68
-
69
- In Next.js, there is no single `main.tsx` entry point. Import the theme CSS **in each client component file** that uses Ignite UI components, or in a shared layout component:
70
-
71
- ```tsx
72
- // app/components/DataTable.tsx
73
- 'use client';
74
-
75
- import 'igniteui-webcomponents/themes/light/bootstrap.css';
76
- import 'igniteui-react-grids/grids/themes/light/bootstrap.css';
77
-
78
- import { IgrGrid, IgrColumn, IgrPaginator } from 'igniteui-react-grids';
79
-
80
- export default function DataTable({ data }: { data: any[] }) {
81
- return (
82
- <IgrGrid data={data} autoGenerate={false}>
83
- <IgrColumn field="name" header="Name" />
84
- <IgrColumn field="email" header="Email" />
85
- <IgrPaginator perPage={10} />
86
- </IgrGrid>
87
- );
88
- }
89
- ```
90
-
91
- Alternatively, import themes once in a root layout:
92
-
93
- ```tsx
94
- // app/layout.tsx
95
- import 'igniteui-webcomponents/themes/light/bootstrap.css';
96
- import 'igniteui-react-grids/grids/themes/light/bootstrap.css';
97
-
98
- export default function RootLayout({ children }: { children: React.ReactNode }) {
99
- return (
100
- <html lang="en">
101
- <body>{children}</body>
102
- </html>
103
- );
104
- }
105
- ```
106
-
107
- ## Minimal App Example (Vite / CRA)
108
-
109
- ```tsx
110
- // main.tsx
111
- import React from 'react';
112
- import ReactDOM from 'react-dom/client';
113
- import 'igniteui-webcomponents/themes/light/bootstrap.css';
114
- import App from './App';
115
-
116
- ReactDOM.createRoot(document.getElementById('root')!).render(
117
- <React.StrictMode>
118
- <App />
119
- </React.StrictMode>
120
- );
121
- ```
122
-
123
- ```tsx
124
- // App.tsx
125
- import { IgrButton, IgrInput } from 'igniteui-react';
126
-
127
- function App() {
128
- return (
129
- <div>
130
- <IgrInput label="Name" />
131
- <IgrButton><span>Submit</span></IgrButton>
132
- </div>
133
- );
134
- }
135
-
136
- export default App;
137
- ```
138
-
139
- > **No `defineComponents()` needed.** React wrappers auto-register. See [CHARTS-GRIDS.md](./reference/CHARTS-GRIDS.md) for exceptions (charts, gauges, maps).
@@ -1,187 +0,0 @@
1
- # JSX Usage Patterns
2
-
3
- ## Props vs HTML Attributes
4
-
5
- Ignite UI React components accept props just like any React component. Use JSX expression syntax for dynamic values:
6
-
7
- ```tsx
8
- // ✅ Correct — JSX expression
9
- <IgrInput label="Email" placeholder="you@example.com" type="email" />
10
- <IgrSlider value={50} min={0} max={100} />
11
- <IgrButton disabled={isLoading}>Submit</IgrButton>
12
-
13
- // ❌ Wrong — string for numeric/boolean values
14
- <IgrSlider value="50" />
15
- ```
16
-
17
- ## Children vs Slots
18
-
19
- Ignite UI components use the web component **slot** mechanism under the hood. In JSX, pass children to the default slot and use the `slot` attribute to target named slots:
20
-
21
- ```tsx
22
- <IgrButton>
23
- {/* Default slot — button label */}
24
- <span>Click Me</span>
25
- </IgrButton>
26
-
27
- <IgrCard>
28
- <IgrCardHeader>
29
- <h3 slot="title">Card Title</h3>
30
- <p slot="subtitle">Card subtitle</p>
31
- </IgrCardHeader>
32
- <IgrCardContent>
33
- <p>Default slot content inside the card body.</p>
34
- </IgrCardContent>
35
- <IgrCardActions>
36
- <IgrButton slot="start">Cancel</IgrButton>
37
- <IgrButton slot="end">Confirm</IgrButton>
38
- </IgrCardActions>
39
- </IgrCard>
40
-
41
- <IgrNavDrawerItem>
42
- <span slot="icon">📊</span>
43
- <span slot="content">Dashboard</span>
44
- </IgrNavDrawerItem>
45
- ```
46
-
47
- > **Tip:** Check the component documentation for available slot names. Common slots include `start`, `end`, `prefix`, `suffix`, `header`, `content`, `icon`, `title`, `subtitle`.
48
-
49
- ## Render Props (Grids & Complex Components)
50
-
51
- Some components like the Data Grid support **render props** for custom cell rendering:
52
-
53
- ```tsx
54
- import { IgrBadge } from 'igniteui-react';
55
- import { IgrGrid, IgrColumn } from 'igniteui-react-grids';
56
-
57
- function UserGrid({ users }: { users: User[] }) {
58
- return (
59
- <IgrGrid data={users} autoGenerate={false}>
60
- <IgrColumn field="name" header="Name" />
61
- <IgrColumn field="email" header="Email" />
62
- <IgrColumn
63
- field="status"
64
- header="Status"
65
- bodyTemplate={(ctx) => (
66
- <IgrBadge>{ctx.cell.value}</IgrBadge>
67
- )}
68
- />
69
- </IgrGrid>
70
- );
71
- }
72
- ```
73
-
74
- ## IgrTabs — Content Panels vs Navigation
75
-
76
- `IgrTabs` supports two distinct usage patterns. Choosing the wrong one is a common mistake.
77
-
78
- ### Pattern 1: Tabs with Content Panels (inline content)
79
-
80
- Use `IgrTab` with inline content when the tabbed content is rendered inline — no routing involved. The tab label can be set via a `label` prop or via a `slot="label"` element:
81
-
82
- ```tsx
83
- import { IgrTabs, IgrTab } from 'igniteui-react';
84
-
85
- // Simple text labels using the label prop
86
- function SettingsPage() {
87
- return (
88
- <IgrTabs>
89
- <IgrTab label="Profile" selected>
90
- <p>Profile settings content here</p>
91
- </IgrTab>
92
- <IgrTab label="Security">
93
- <p>Security settings content here</p>
94
- </IgrTab>
95
- <IgrTab label="Notifications">
96
- <p>Notification preferences content here</p>
97
- </IgrTab>
98
- </IgrTabs>
99
- );
100
- }
101
- ```
102
-
103
- **Alternative: Using slot="label" for complex headers (e.g., with icons):**
104
-
105
- ```tsx
106
- import { IgrTabs, IgrTab, IgrIcon } from 'igniteui-react';
107
-
108
- function SettingsPage() {
109
- return (
110
- <IgrTabs>
111
- <IgrTab selected>
112
- <span slot="label">
113
- <IgrIcon name="home" collection="material" />
114
- Profile
115
- </span>
116
- <p>Profile settings content here</p>
117
- </IgrTab>
118
- <IgrTab>
119
- <span slot="label">
120
- <IgrIcon name="security" collection="material" />
121
- Security
122
- </span>
123
- <p>Security settings content here</p>
124
- </IgrTab>
125
- <IgrTab>
126
- <span slot="label">
127
- <IgrIcon name="notifications" collection="material" />
128
- Notifications
129
- </span>
130
- <p>Notification preferences content here</p>
131
- </IgrTab>
132
- </IgrTabs>
133
- );
134
- }
135
- ```
136
-
137
- ### Pattern 2: Tabs as Navigation (with React Router — NO inline content)
138
-
139
- > **⚠️ CRITICAL:** When using `IgrTabs` for navigation with React Router (or any router), **do NOT include inline content in `IgrTab`**. Only render tab labels (via `label` prop or `slot="label"`), and let the router's `<Outlet />` handle the content below the tabs.
140
-
141
- ```tsx
142
- import { IgrTabs, IgrTab } from 'igniteui-react';
143
- import { useNavigate, useLocation, Outlet } from 'react-router-dom';
144
-
145
- const tabs = [
146
- { path: '/dashboard', label: 'Dashboard' },
147
- { path: '/orders', label: 'Orders' },
148
- { path: '/customers', label: 'Customers' },
149
- ];
150
-
151
- function MainLayout() {
152
- const navigate = useNavigate();
153
- const location = useLocation();
154
-
155
- const handleTabChange = (e: CustomEvent) => {
156
- const selectedLabel = (e.detail as any).label as string;
157
- const tab = tabs.find(t => t.label === selectedLabel);
158
- if (tab) navigate(tab.path);
159
- };
160
-
161
- return (
162
- <div>
163
- {/* Tabs for navigation — label prop only, no inline content */}
164
- <IgrTabs onChange={handleTabChange}>
165
- {tabs.map((tab) => (
166
- <IgrTab
167
- key={tab.path}
168
- label={tab.label}
169
- selected={location.pathname === tab.path}
170
- />
171
- ))}
172
- </IgrTabs>
173
-
174
- {/* Router outlet renders the routed view */}
175
- <main>
176
- <Outlet />
177
- </main>
178
- </div>
179
- );
180
- }
181
- ```
182
-
183
- **Key rules for tabs-as-navigation:**
184
- - ✅ Use only `IgrTab` with label prop or `slot="label"` — no inline content
185
- - ✅ Sync the active tab to the current route using the `selected` prop
186
- - ✅ Handle `onChange` to call `navigate()` for route changes
187
- - ✅ Use `<Outlet />` (or the equivalent in your router) for content rendering
@@ -1,77 +0,0 @@
1
- # Setting Up the Ignite UI CLI MCP Server
2
-
3
- > **Part of the [`igniteui-react-components`](../SKILL.md) skill hub.**
4
-
5
- ## Contents
6
-
7
- - [VS Code](#vs-code)
8
- - [Cursor](#cursor)
9
- - [Claude Desktop](#claude-desktop)
10
- - [WebStorm / JetBrains IDEs](#webstorm--jetbrains-ides)
11
- - [Verifying the Setup](#verifying-the-setup)
12
-
13
- The Ignite UI CLI MCP server enables AI assistants to generate production-ready theming code. It must be configured in your editor before the theming tools become available.
14
-
15
- ## VS Code
16
-
17
- Create or edit `.vscode/mcp.json` in your project:
18
-
19
- ```json
20
- {
21
- "servers": {
22
- "igniteui-cli": {
23
- "command": "npx",
24
- "args": ["-y", "igniteui-cli", "mcp"]
25
- }
26
- }
27
- }
28
- ```
29
-
30
- This works whether `igniteui-cli` is installed locally in `node_modules` or needs to be pulled from the npm registry — `npx -y` handles both cases.
31
-
32
- ## Cursor
33
-
34
- Create or edit `.cursor/mcp.json`:
35
-
36
- ```json
37
- {
38
- "mcpServers": {
39
- "igniteui-cli": {
40
- "command": "npx",
41
- "args": ["-y", "igniteui-cli", "mcp"]
42
- }
43
- }
44
- }
45
- ```
46
-
47
- ## Claude Desktop
48
-
49
- Edit the Claude Desktop config file:
50
- - **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
51
- - **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
52
-
53
- ```json
54
- {
55
- "mcpServers": {
56
- "igniteui-cli": {
57
- "command": "npx",
58
- "args": ["-y", "igniteui-cli", "mcp"]
59
- }
60
- }
61
- }
62
- ```
63
-
64
- ## WebStorm / JetBrains IDEs
65
-
66
- 1. Go to **Settings → Tools → AI Assistant → MCP Servers**
67
- 2. Click **+ Add MCP Server**
68
- 3. Set Command to `npx` and Arguments to `-y igniteui-cli mcp`
69
- 4. Click OK and restart the AI Assistant
70
-
71
- ## Verifying the Setup
72
-
73
- After configuring the MCP server, ask your AI assistant:
74
-
75
- > "List all available Ignite UI components"
76
-
77
- If the MCP server is running, the `list_components` tool will return all available components for the detected framework.
@@ -1,232 +0,0 @@
1
- # Refs & Forms
2
-
3
- ## Refs & Imperative API
4
-
5
- Use `useRef` to access the underlying web component element and call imperative methods (e.g., showing/hiding a dialog, focusing an input).
6
- Components from `igniteui-react`, `igniteui-react-grids` and `igniteui-react-dockmanager` are React Function Components forward the native element to `useRef` and expose alias with the same name for accessing the custom element API:
7
-
8
- ```tsx
9
- import { useRef } from 'react';
10
- import { IgrDialog, IgrButton, IgrInput } from 'igniteui-react';
11
-
12
- function MyPage() {
13
- const dialogRef = useRef<IgrDialog>(null);
14
- const inputRef = useRef<IgrInput>(null);
15
-
16
- const openDialog = () => {
17
- // Access the underlying web component and call its methods
18
- dialogRef.current?.show();
19
- };
20
-
21
- const focusInput = () => {
22
- inputRef.current?.focus();
23
- };
24
-
25
- return (
26
- <>
27
- <IgrButton onClick={openDialog}>
28
- <span>Open Dialog</span>
29
- </IgrButton>
30
-
31
- <IgrDialog ref={dialogRef} title="Confirmation">
32
- <p>Are you sure?</p>
33
- <IgrButton slot="footer" onClick={() => dialogRef.current?.hide()}>
34
- <span>Close</span>
35
- </IgrButton>
36
- </IgrDialog>
37
-
38
- <IgrButton onClick={focusInput}>
39
- <span>Focus Input</span>
40
- </IgrButton>
41
- <IgrInput ref={inputRef} label="Name" />
42
- </>
43
- );
44
- }
45
- ```
46
-
47
- > **Tip:** The ref gives you direct access to the web component's DOM element. You can call any method documented in the web component API.
48
-
49
-
50
- ## Uncontrolled Components
51
-
52
- `igniteui-react` Form elements like Inputs, Select, Checkbox, etc., integrate with the native form handling through Element internals, allowing to take advantage of the native state management and validation to create intuitive, straightforward forms. Use the `name` attribute to register the field value with `FormData`:
53
-
54
- ```tsx
55
- import { IgrInput, IgrSelect, IgrSelectItem, IgrButton } from 'igniteui-react';
56
-
57
- function SimpleForm() {
58
- const handleSubmit = (e: React.SubmitEvent<HTMLFormElement>) => {
59
- // e.preventDefault(); // optionally prevent default submit for custom handling
60
- const formData = new FormData(e.currentTarget);
61
- console.log(formData.get('name')); // input value
62
- console.log(formData.get('role')); // selected option value
63
- };
64
-
65
- return (
66
- <form onSubmit={handleSubmit}>
67
- <IgrInput name="name" label="Name" required={true} />
68
- <IgrSelect name="role" label="Role" required={true}>
69
- <IgrSelectItem value="user">User</IgrSelectItem>
70
- <IgrSelectItem value="admin">Admin</IgrSelectItem>
71
- <IgrSelectItem value="editor">Editor</IgrSelectItem>
72
- </IgrSelect>
73
- <IgrButton type="submit">
74
- <span>Submit</span>
75
- </IgrButton>
76
- </form>
77
- );
78
- }
79
- ```
80
-
81
- ## Controlled Components with `useState`
82
-
83
- Wire up Ignite UI form components with React state for controlled behavior:
84
-
85
- ```tsx
86
- import { useState } from 'react';
87
- import { IgrInput, IgrCheckbox, IgrSelect, IgrSelectItem, IgrCheckboxChangeEventArgsDetail } from 'igniteui-react';
88
-
89
- function ProfileForm() {
90
- const [name, setName] = useState('');
91
- const [newsletter, setNewsletter] = useState(false);
92
- const [role, setRole] = useState('user');
93
-
94
- return (
95
- <form>
96
- <IgrInput
97
- label="Name"
98
- value={name}
99
- onInput={(e: CustomEvent<string>) => setName(e.detail) }
100
- />
101
-
102
- <IgrCheckbox
103
- checked={newsletter}
104
- onChange={(e: CustomEvent<IgrCheckboxChangeEventArgsDetail>) =>
105
- setNewsletter(e.detail.checked)
106
- }
107
- >
108
- Subscribe to newsletter
109
- </IgrCheckbox>
110
-
111
- <IgrSelect
112
- label="Role"
113
- value={role}
114
- onChange={(e: CustomEvent<IgrSelectItem>) =>
115
- setRole(e.detail.value)
116
- }
117
- >
118
- <IgrSelectItem value="user">User</IgrSelectItem>
119
- <IgrSelectItem value="admin">Admin</IgrSelectItem>
120
- <IgrSelectItem value="editor">Editor</IgrSelectItem>
121
- </IgrSelect>
122
- </form>
123
- );
124
- }
125
- ```
126
-
127
- ## React Hook Form Integration
128
-
129
- Ignite UI components are form-associated web components. You can integrate them with React Hook Form using `Controller`:
130
-
131
- ```tsx
132
- import { useForm, Controller } from 'react-hook-form';
133
- import { IgrInput, IgrCheckbox, IgrButton, IgrCheckboxChangeEventArgsDetail } from 'igniteui-react';
134
-
135
- interface FormData {
136
- email: string;
137
- acceptTerms: boolean;
138
- }
139
-
140
- function SignUpForm() {
141
- const { control, handleSubmit, formState: { errors } } = useForm<FormData>();
142
-
143
- const onSubmit = (data: FormData) => {
144
- console.log(data);
145
- };
146
-
147
- return (
148
- <form onSubmit={handleSubmit(onSubmit)}>
149
- <Controller
150
- name="email"
151
- control={control}
152
- rules={{ required: 'Email is required' }}
153
- render={({ field }) => (
154
- <IgrInput
155
- label="Email"
156
- type="email"
157
- value={field.value || ''}
158
- onInput={(e: CustomEvent<string>) =>
159
- field.onChange(e.detail)
160
- }
161
- onBlur={() => field.onBlur()}
162
- invalid={!!errors.email}
163
- />
164
- )}
165
- />
166
- {errors.email && <span>{errors.email.message}</span>}
167
-
168
- <Controller
169
- name="acceptTerms"
170
- control={control}
171
- rules={{ required: 'You must accept the terms' }}
172
- render={({ field }) => (
173
- <IgrCheckbox
174
- checked={field.value || false}
175
- onChange={(e: CustomEvent<IgrCheckboxChangeEventArgsDetail>) =>
176
- field.onChange(e.detail.checked)
177
- }
178
- >
179
- I accept the terms and conditions
180
- </IgrCheckbox>
181
- )}
182
- />
183
-
184
- <IgrButton type="submit">
185
- <span>Sign Up</span>
186
- </IgrButton>
187
- </form>
188
- );
189
- }
190
- ```
191
-
192
- ## TypeScript
193
-
194
- ### Importing Component Types
195
-
196
- Each component exports its props interface. Import and use them for type-safe code:
197
-
198
- ```tsx
199
- import { IgrButton, IgrInput } from 'igniteui-react';
200
- import type { ComponentProps } from 'react';
201
-
202
- // Get the props type for a component
203
- type ButtonProps = ComponentProps<typeof IgrButton>;
204
- type InputProps = ComponentProps<typeof IgrInput>;
205
-
206
- // Use in your own components
207
- interface FormFieldProps {
208
- label: string;
209
- inputProps?: Partial<InputProps>;
210
- }
211
-
212
- function FormField({ label, inputProps }: FormFieldProps) {
213
- return (
214
- <div>
215
- <IgrInput label={label} {...inputProps} />
216
- </div>
217
- );
218
- }
219
- ```
220
-
221
- ### Auto-complete
222
-
223
- IDEs with TypeScript support will provide auto-complete for all `Igr*` component props. Make sure your `tsconfig.json` includes:
224
-
225
- ```json
226
- {
227
- "compilerOptions": {
228
- "jsx": "react-jsx",
229
- "moduleResolution": "bundler"
230
- }
231
- }
232
- ```
@@ -1,67 +0,0 @@
1
- # Ignite UI Theming MCP Server
2
-
3
- The Ignite UI Theming MCP server enables AI assistants to generate production-ready theming code. It must be configured in your editor before the theming tools become available.
4
-
5
- > **AGENT INSTRUCTION — MCP Server Setup (REQUIRED)**
6
- >
7
- > Before using any theming tools, you MUST verify the MCP server is available
8
- > by calling `detect_platform`. If the tool is not available or the call fails,
9
- > configure it by following the setup steps below.
10
-
11
- ## VS Code Setup
12
-
13
- Create or edit `.vscode/mcp.json` in your project:
14
-
15
- ```json
16
- {
17
- "servers": {
18
- "igniteui-theming": {
19
- "command": "npx",
20
- "args": ["-y", "igniteui-theming", "igniteui-theming-mcp"]
21
- }
22
- }
23
- }
24
- ```
25
-
26
- ## Cursor Setup
27
-
28
- Create or edit `.cursor/mcp.json`:
29
-
30
- ```json
31
- {
32
- "mcpServers": {
33
- "igniteui-theming": {
34
- "command": "npx",
35
- "args": ["-y", "igniteui-theming", "igniteui-theming-mcp"]
36
- }
37
- }
38
- }
39
- ```
40
-
41
- ## Claude Desktop Setup
42
-
43
- Edit the Claude Desktop config file:
44
- - **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
45
- - **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
46
-
47
- ```json
48
- {
49
- "mcpServers": {
50
- "igniteui-theming": {
51
- "command": "npx",
52
- "args": ["-y", "igniteui-theming", "igniteui-theming-mcp"]
53
- }
54
- }
55
- }
56
- ```
57
-
58
- ## WebStorm / JetBrains IDEs Setup
59
-
60
- 1. Go to **Settings → Tools → AI Assistant → MCP Servers**
61
- 2. Click **+ Add MCP Server**
62
- 3. Set Command to `npx` and Arguments to `igniteui-theming igniteui-theming-mcp`
63
- 4. Click OK and restart the AI Assistant
64
-
65
- ## File Safety Rule
66
-
67
- > **IMPORTANT — File Safety Rule**: When generating theme code, **never overwrite existing style files directly**. Always propose changes as an update and let the user review before writing to disk.