|
| 1 | +--- |
| 2 | +name: igniteui-react-components |
| 3 | +description: This skill identifies the right Ignite UI for React components for any UI pattern and covers installing, importing, and using them — including JSX patterns, event handling, refs, forms, and TypeScript. Use this when choosing components, setting up a React project, writing component JSX, handling events, or integrating with React state and form libraries. |
| 4 | +user-invocable: true |
| 5 | +--- |
| 6 | + |
| 7 | +# Ignite UI for React Components |
| 8 | + |
| 9 | +This skill covers everything from identifying the right component for a UI requirement to installing, setting up, and using Ignite UI for React components — including JSX patterns, event handling, refs, controlled/uncontrolled form components, and TypeScript. |
| 10 | + |
| 11 | +## Example Usage |
| 12 | + |
| 13 | +- "What component should I use to display a list of items with actions?" |
| 14 | +- "I need a date picker for a booking form in React" |
| 15 | +- "Build a dashboard layout with cards and a data grid" |
| 16 | +- "What's the best component for a navigation sidebar?" |
| 17 | +- "I need a searchable dropdown with multi-select" |
| 18 | +- "How do I install Ignite UI for React?" |
| 19 | +- "Set up igniteui-react in my project" |
| 20 | +- "How do I handle events on IgrCombo?" |
| 21 | +- "How do I use IgrInput with React Hook Form?" |
| 22 | +- "Show me how to use refs with IgrDialog" |
| 23 | +- "What TypeScript types should I use for IgrButton props?" |
| 24 | +- "How do I pass children vs slots to Ignite UI components?" |
| 25 | + |
| 26 | +## Related Skills |
| 27 | + |
| 28 | +- [igniteui-react-customize-theme](../igniteui-react-customize-theme/SKILL.md) — Theme and style components |
| 29 | +- [igniteui-react-optimize-bundle-size](../igniteui-react-optimize-bundle-size/SKILL.md) — Reduce bundle size |
| 30 | + |
| 31 | +## When to Use |
| 32 | + |
| 33 | +- Deciding which component fits a UI requirement |
| 34 | +- User describes a UI pattern and needs a matching component name |
| 35 | +- User wants to explore what components are available |
| 36 | +- Setting up Ignite UI for React in a new or existing project |
| 37 | +- Writing JSX that uses Ignite UI components |
| 38 | +- Handling events from Ignite UI components |
| 39 | +- Integrating components with React state or form libraries |
| 40 | +- Using refs to call imperative methods on components |
| 41 | +- Working with TypeScript prop types |
| 42 | + |
| 43 | +--- |
| 44 | + |
| 45 | +## Content Guide |
| 46 | + |
| 47 | +This skill is organized into focused reference files. Load the appropriate file for the situation: |
| 48 | + |
| 49 | +| Topic | File | When to Use | |
| 50 | +|---|---|---| |
| 51 | +| Component Catalogue | [COMPONENT-CATALOGUE.md](./reference/COMPONENT-CATALOGUE.md) | Mapping UI patterns to components, available packages, common UI scenarios | |
| 52 | +| Installation & Setup | [INSTALLATION.md](./reference/INSTALLATION.md) | Setting up packages, importing theme CSS, Next.js setup | |
| 53 | +| JSX Patterns | [JSX-PATTERNS.md](./reference/JSX-PATTERNS.md) | Props, children, slots, IgrTabs content vs navigation | |
| 54 | +| Event Handling | [EVENT-HANDLING.md](./reference/EVENT-HANDLING.md) | Event props, CustomEvent types, common events | |
| 55 | +| Refs & Forms | [REFS-FORMS.md](./reference/REFS-FORMS.md) | useRef, controlled/uncontrolled forms, React Hook Form | |
| 56 | +| Charts, Gauges, Maps & Grid Lite | [CHARTS-GRIDS.md](./reference/CHARTS-GRIDS.md) | Module registration, container sizing | |
| 57 | +| Reveal SDK | [REVEAL-SDK.md](./reference/REVEAL-SDK.md) | Embedded BI dashboards, theme sync | |
| 58 | +| Troubleshooting | [TROUBLESHOOTING.md](./reference/TROUBLESHOOTING.md) | Common issues and solutions | |
| 59 | + |
| 60 | +--- |
| 61 | + |
| 62 | +## Quick Start |
| 63 | + |
| 64 | +### 1. Install |
| 65 | + |
| 66 | +```bash |
| 67 | +npm install igniteui-react |
| 68 | +``` |
| 69 | + |
| 70 | +### 2. Import Theme CSS (REQUIRED) |
| 71 | + |
| 72 | +```tsx |
| 73 | +// main.tsx |
| 74 | +import 'igniteui-webcomponents/themes/light/bootstrap.css'; |
| 75 | +``` |
| 76 | + |
| 77 | +> **CRITICAL:** Without the theme CSS, components will render without styles and icons will be broken. See [INSTALLATION.md](./reference/INSTALLATION.md) for all available themes and setup. |
| 78 | +
|
| 79 | +### 3. Use Components |
| 80 | + |
| 81 | +```tsx |
| 82 | +import { IgrButton, IgrInput } from 'igniteui-react'; |
| 83 | + |
| 84 | +function App() { |
| 85 | + return ( |
| 86 | + <div> |
| 87 | + <IgrInput label="Name" /> |
| 88 | + <IgrButton><span>Submit</span></IgrButton> |
| 89 | + </div> |
| 90 | + ); |
| 91 | +} |
| 92 | +``` |
| 93 | + |
| 94 | +> **No `defineComponents()` needed.** React wrappers auto-register. See [CHARTS-GRIDS.md](./reference/CHARTS-GRIDS.md) for exceptions (charts, gauges, maps). |
| 95 | +
|
| 96 | +--- |
| 97 | + |
| 98 | +## Key Concepts |
| 99 | + |
| 100 | +### Choosing the Right Component |
| 101 | + |
| 102 | +Use [COMPONENT-CATALOGUE.md](./reference/COMPONENT-CATALOGUE.md) to map any UI need to the right `Igr*` component and package. For quick guidance: |
| 103 | + |
| 104 | +- **MIT package** (`igniteui-react`) — inputs, buttons, layout, navigation, notifications, scheduling, AI chat |
| 105 | +- **Lightweight grid** (MIT) — `IgrGridLite` from `igniteui-react/grid-lite` (requires both `igniteui-react` and `igniteui-grid-lite`) |
| 106 | +- **Commercial** — `igniteui-react-grids` (advanced grids), `igniteui-react-charts`, `igniteui-react-gauges`, `igniteui-react-maps` |
| 107 | + |
| 108 | +### Theme CSS Import |
| 109 | + |
| 110 | +- **Always import theme CSS** before using components. **For grids**, also import `igniteui-react-grids/grids/themes/...` |
| 111 | +- see [INSTALLATION.md](./reference/INSTALLATION.md) |
| 112 | + |
| 113 | +### JSX Patterns |
| 114 | + |
| 115 | +- Use props just like any React component |
| 116 | +- Use `slot` attribute for named slots: `<span slot="icon">📊</span>` |
| 117 | +- See [JSX-PATTERNS.md](./reference/JSX-PATTERNS.md) |
| 118 | + |
| 119 | +### IgrTabs: Content vs Navigation |
| 120 | + |
| 121 | +- **Content panels**: Use `IgrTab` with inline content (label via `label` prop or `slot="label"`) |
| 122 | +- **Navigation (router)**: Use **only `IgrTab`** with label-only (no inline content) |
| 123 | +- See [JSX-PATTERNS.md](./reference/JSX-PATTERNS.md) |
| 124 | + |
| 125 | +### Events |
| 126 | + |
| 127 | +- Events are `CustomEvent` objects, not React `SyntheticEvent` |
| 128 | +- Access data via `e.target` or `e.detail` |
| 129 | +- See [EVENT-HANDLING.md](./reference/EVENT-HANDLING.md) |
| 130 | + |
| 131 | +### Refs |
| 132 | + |
| 133 | +- Use `useRef<IgrDialog>(null)` with the component type: |
| 134 | +- See [REFS-FORMS.md](./reference/REFS-FORMS.md) |
| 135 | + |
| 136 | +### Charts, Gauges, Maps & Grid Lite |
| 137 | + |
| 138 | +- **Charts/Gauges/Maps require explicit registration**: `IgrCategoryChartModule.register()` |
| 139 | +- **All require sized container**: `min-width`, `min-height`, or `flex-grow` |
| 140 | +- **Grid Lite** requires both `igniteui-react` and `igniteui-grid-lite` packages, import from `igniteui-react/grid-lite` |
| 141 | +- See [CHARTS-GRIDS.md](./reference/CHARTS-GRIDS.md) |
| 142 | + |
| 143 | +--- |
| 144 | + |
| 145 | +## Best Practices |
| 146 | + |
| 147 | +1. **Start with the MIT package** (`igniteui-react`) — it covers most common UI needs |
| 148 | +2. **Import theme CSS first** — components need it to render correctly |
| 149 | +3. **Register chart/gauge/map modules** — call `.register()` at module level |
| 150 | +4. **Wrap charts/gauges/maps in sized containers** — they need explicit dimensions |
| 151 | +5. **Use named imports** — enables tree-shaking |
| 152 | +6. **Handle events as `CustomEvent`** — not `React.SyntheticEvent` |
| 153 | +7. **Use refs sparingly** — prefer declarative props |
| 154 | +8. **Check slot names** in the docs |
| 155 | + |
| 156 | +## Additional Resources |
| 157 | + |
| 158 | +- [Ignite UI for React — Getting Started](https://www.infragistics.com/products/ignite-ui-react/react/components/general-getting-started) |
| 159 | +- [React Examples Repository](https://github.com/IgniteUI/igniteui-react-examples) |
| 160 | +- [npm: igniteui-react](https://www.npmjs.com/package/igniteui-react) |
| 161 | +- [@lit/react Documentation](https://lit.dev/docs/frameworks/react/) |
0 commit comments