You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> **CRITICAL:** Theme CSS imports are **required** for components to render correctly. Without them, components will appear unstyled, with missing icons and broken layouts.
83
+
84
+
**For grids**, you **must also** import the grid theme CSS:
|`igniteui-webcomponents-grids/grids/themes/dark/indigo.css`| Grid Indigo Dark |
116
+
117
+
> **Note:** The theme CSS comes from the underlying `igniteui-webcomponents` and `igniteui-webcomponents-grids` packages (dependencies of `igniteui-react` and `igniteui-react-grids`).
118
+
119
+
### Next.js
120
+
121
+
In Next.js, import the theme CSS in each client component file that uses Ignite UI components, or in a shared root layout:
Components require a CSS theme to render correctly. Import one in your entry point (`main.tsx`, `index.tsx`, or `App.tsx`):
69
+
> **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.**
70
+
71
+
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).
> **Note:** The theme CSS is imported from the underlying `igniteui-webcomponents` package (a dependency of `igniteui-react`), not from `igniteui-react` itself.
98
+
> **Note:** The theme CSS is imported from the underlying `igniteui-webcomponents` and `igniteui-webcomponents-grids` packages (dependencies of `igniteui-react` and `igniteui-react-grids`), not from `igniteui-react` itself.
99
+
100
+
### Next.js Setup
101
+
102
+
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:
exportdefaultfunction RootLayout({ children }: { children:React.ReactNode }) {
132
+
return (
133
+
<htmllang="en">
134
+
<body>{children}</body>
135
+
</html>
136
+
);
137
+
}
138
+
```
97
139
98
-
### Minimal App Example
140
+
### Minimal App Example (Vite / CRA)
99
141
100
142
```tsx
101
143
// main.tsx
@@ -530,12 +572,39 @@ IDEs with TypeScript support will provide auto-complete for all `Igr*` component
530
572
531
573
### Issue: Components render without styles
532
574
533
-
**Cause:** Missing theme CSS import.
575
+
**Cause:** Missing theme CSS import. Without the theme CSS, components will render with broken layouts, missing icons (showing placeholders), and no visual styling.
534
576
535
-
**Solution:** Add a theme import in your entry point:
577
+
**Solution:** Add the theme CSS import **before** any component usage. In Vite/CRA apps, add it to your entry point. In Next.js, add it to each client component file or the root layout:
1.**Import a theme CSS**in your app entry point — components will not render correctly without it
655
+
1.**Always import theme CSS** — components will not render correctly without it. Import `igniteui-webcomponents/themes/...` for core components and additionally `igniteui-webcomponents-grids/grids/themes/...` for grids. In Next.js, import in each client component file or the root layout
587
656
2.**Don't call `defineComponents()`** — the React wrappers handle registration automatically
588
657
3.**Use named imports** — `import { IgrButton } from 'igniteui-react'` enables tree-shaking
589
658
4.**Handle events as `CustomEvent`** — not `React.SyntheticEvent`
0 commit comments