Ignite UI for Web Components
repository·master·Indexed 41 days ago
https://github.com/igniteui/igniteui-webcomponentsA high-performance library of reusable UI components for modern web applications, featuring data grids, charts, and layout managers. The core package provides MIT-licensed components for data input, layout, navigation, and feedback, while commercial packages offer advanced Pivot, Data, Tree, and Hierarchical Grids, as well as a Dock Manager for complex windowing experiences.
What's inside Ignite UI for Web Components
- Ignite UI for Web Components is a comprehensive library of high-performance UI components designed for modern web applications. It features a wide array of tools including high-speed Data Grids, Hierarchical Grids, Pivot Grids, over 60 data Charts, and a Dock Manager for complex layout management. The library is built to provide superior performance and interactive features across various devices.
Use MCP lookup patterns to find component details
masterWhen using an AI agent with MCP (Model Context Protocol) capabilities to work with Ignite UI Web Components, use these specific lookup patterns to find documentation, APIs, and class names:
- Find component documentation names: Use
list_components({ framework: "webcomponents", filter: "<keyword>" }) - Get usage examples and slots: Use
get_doc({ framework: "webcomponents", name: "<doc-name>" }) - Find exact class names: Use
search_api({ platform: "webcomponents", query: "<keyword>" }) - Get full property/method/event API: Use
get_api_reference({ platform: "webcomponents", component: "<ClassName>" })
- Find component documentation names: Use
Identify the correct Ignite UI package for your components
masterComponents are distributed across several packages depending on their license and functionality:
igniteui-webcomponents: MIT components including inputs, layout, notifications, scheduling, and chat.igniteui-webcomponents-grids: Commercial package for advanced grids (Data Grid, Tree Grid, Hierarchical Grid, Pivot Grid).igniteui-grid-lite: MIT package for the lightweight Grid Lite component.igniteui-dockmanager: Commercial package for docking layouts.igniteui-webcomponents-charts: Commercial package for charts & visualizations (Category Chart, Data Chart, Financial Chart, Pie Chart, Sparkline, Treemap, etc.).
Theming Rules and Best Practices
masterFollow these rules to ensure theme consistency and maintainability:
- Platform Detection: Always call
detect_platformfirst when using MCP tools. - Token Discovery: Always call
get_component_design_tokensbeforecreate_component_theme. - Color Shades: For chromatic colors, palette shades range from
50(lightest) to900(darkest). Do not invert these for dark themes; only gray shades should be inverted. - Surface Colors: The
--ig-surface-500color must match the variant (light color forlightvariant, dark color fordarkvariant). - Sass Specifics:
- Use the
igniteui-themingmodule for Web Components. - Do not use Angular-specific
core()ortheme()mixins. - Component themes must use
create_component_themeto generate@include tokens($theme)inside the correct selector.
- Use the
- Compound Components: When theming compound components, follow the full checklist from
get_component_design_tokensand theme each child component with its own scoped selector. - No Hardcoding: Once a palette is generated, every color in component themes, custom CSS, and Sass variables must use
var(--ig-<family>-<shade>)tokens.
- Platform Detection: Always call
Theme Compound Components
masterCompound components (like
combo,grid,date-picker, orselect) contain internal child components that each require their own theming.To theme a compound component:
- Use
get_component_design_tokenson the parent component (e.g.,date-picker). - Identify the related child themes and scope selectors provided in the response.
- Use
create_component_themefor each child component, wrapping them in the parent's selector to ensure correct scoping.
- Use
Dock Manager - Exclusive Feature
masterThe Dock Manager provides a complete windowing experience, allowing developers to split complex application layouts into smaller, manageable panes.
- Package:
igniteui-dockmanager - License: Commercial
- Usage: Use this feature to create sophisticated, pane-based user interfaces.
- Package:
Use the `igc-theme-provider` for scoped theming
masterTheigc-theme-providercomponent allows for scoped theming using the Lit context API. This enables you to apply different themes to different parts of a single page by wrapping specific component trees in a provider.Set Complex Properties (Objects and Arrays)
masterHTML attributes only support strings. To pass complex data types like objects or arrays to a component, you must set them as DOM properties via JavaScript rather than using HTML attributes.
// ❌ Wrong — attributes only accept strings // <igc-combo data="[{...}]"></igc-combo> // ✅ Correct — set via DOM property const combo = document.querySelector('igc-combo'); combo.data = [ { value: 1, label: 'Item 1' }, { value: 2, label: 'Item 2' } ];Decompose design images into implementation briefs
masterTo ensure accurate implementation, translate a design image into a decomposition table. This helps identify the necessary Ignite UI components and potential CSS overrides before coding begins.
Region Visual role Candidate component Custom CSS required Data type Example: sidebar item list repeated rows with icon + label IgcListComponent+IgcListItemComponentyes - item height, icon size domain-appropriate mock data Example: top bar brand + tabs + search IgcNavbarComponentyes - multi-zone slot layout n/a Example: side panel always-visible navigation IgcNavDrawerComponentyes - width, item styling n/a Note: Always prioritize the most appropriate Ignite UI component. Only fall back to plain semantic HTML if the component's DOM structure is fundamentally incompatible after considering slots and
::part(...)selectors. If you use plain HTML, document the reason in a code comment.| Region | Visual role | Candidate component | Custom CSS required | Data type | |---|---|---|---|---| | Example: sidebar item list | repeated rows with icon + label | `IgcListComponent` + `IgcListItemComponent` | yes - item height, icon size | domain-appropriate mock data | | Example: top bar | brand + tabs + search | `IgcNavbarComponent` | yes - multi-zone slot layout | n/a | | Example: side panel | always-visible navigation | `IgcNavDrawerComponent` | yes - width, item styling | n/a |Understand the Ignite UI Web Components Theming Architecture
masterThe theming system is built on four pillars that work together to define the visual identity of your application:
- Palette: Color families including
primary,secondary,surface,gray,info,success,warn, anderror. Each family contains shades from 50 to 900. - Typography: Defines the font family and the type scale (headings, body, captions, etc.).
- Elevations: Defines box-shadow levels ranging from 0 to 24.
- Schema: Per-component recipes that map palette tokens to specific component-level CSS custom properties.
There are four built-in design systems available, each with light and dark variants:
- Material (
light/material.css,dark/material.css) - Bootstrap (
light/bootstrap.css,dark/bootstrap.css) - Fluent (
light/fluent.css,dark/fluent.css) - Indigo (
light/indigo.css,dark/indigo.css)
- Palette: Color families including
TypeScript support for Ignite UI React
masterThe
igniteui-reactpackage includes full type definitions. AllIgr*component props are typed, and DOM queries for the underlying web components are automatically typed viaHTMLElementTagNameMap(provided by theigniteui-webcomponentspeer dependency).import { IgrButton } from 'igniteui-react'; // TypeScript knows about all IgrButton props <IgrButton variant="contained">Click</IgrButton> // DOM queries are also typed automatically const button = document.querySelector('igc-button'); // IgbButtonComponent | nullOptimize Ignite UI Web Components bundle size
masterTo minimize application bundle size when using
igniteui-webcomponents, follow these key principles:- Avoid
defineAllComponents(): This function imports all 60+ components, adding ~500KB+ to your bundle. - Use
defineComponents()with named imports: Import only the specific component classes you need to enable effective tree-shaking. - Lazy load components: Load heavy components (like dialogs or modals) on demand rather than at application startup.
- Implement route-based code splitting: Register components within lazy-loaded route modules so they are only included in the chunks required for those specific routes.
import { defineComponents, IgcButtonComponent, IgcInputComponent, IgcCardComponent } from 'igniteui-webcomponents'; defineComponents(IgcButtonComponent, IgcInputComponent, IgcCardComponent);- Avoid