Ignite UI for Web Components

repository·master·Indexed 41 days ago

https://github.com/igniteui/igniteui-webcomponents

A 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.

Tokens
43.1K
Snippets
132
Records
185
Agent score
48%

What's inside Ignite UI for Web Components

  1. Overview of Ignite UI for Web Components

    master
    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.
  2. Use MCP lookup patterns to find component details

    master

    When 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>" })
  3. Identify the correct Ignite UI package for your components

    master

    Components 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.).
  4. Theming Rules and Best Practices

    master

    Follow these rules to ensure theme consistency and maintainability:

    • Platform Detection: Always call detect_platform first when using MCP tools.
    • Token Discovery: Always call get_component_design_tokens before create_component_theme.
    • Color Shades: For chromatic colors, palette shades range from 50 (lightest) to 900 (darkest). Do not invert these for dark themes; only gray shades should be inverted.
    • Surface Colors: The --ig-surface-500 color must match the variant (light color for light variant, dark color for dark variant).
    • Sass Specifics:
      • Use the igniteui-theming module for Web Components.
      • Do not use Angular-specific core() or theme() mixins.
      • Component themes must use create_component_theme to generate @include tokens($theme) inside the correct selector.
    • Compound Components: When theming compound components, follow the full checklist from get_component_design_tokens and 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.
  5. Theme Compound Components

    master

    Compound components (like combo, grid, date-picker, or select) contain internal child components that each require their own theming.

    To theme a compound component:

    1. Use get_component_design_tokens on the parent component (e.g., date-picker).
    2. Identify the related child themes and scope selectors provided in the response.
    3. Use create_component_theme for each child component, wrapping them in the parent's selector to ensure correct scoping.
  6. Dock Manager - Exclusive Feature

    master

    The 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.
  7. Set Complex Properties (Objects and Arrays)

    master

    HTML 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' }
    ];
  8. Decompose design images into implementation briefs

    master

    To 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.

    RegionVisual roleCandidate componentCustom CSS requiredData type
    Example: sidebar item listrepeated rows with icon + labelIgcListComponent + IgcListItemComponentyes - item height, icon sizedomain-appropriate mock data
    Example: top barbrand + tabs + searchIgcNavbarComponentyes - multi-zone slot layoutn/a
    Example: side panelalways-visible navigationIgcNavDrawerComponentyes - width, item stylingn/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 |
  9. Understand the Ignite UI Web Components Theming Architecture

    master

    The theming system is built on four pillars that work together to define the visual identity of your application:

    1. Palette: Color families including primary, secondary, surface, gray, info, success, warn, and error. Each family contains shades from 50 to 900.
    2. Typography: Defines the font family and the type scale (headings, body, captions, etc.).
    3. Elevations: Defines box-shadow levels ranging from 0 to 24.
    4. 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)
  10. TypeScript support for Ignite UI React

    master

    The igniteui-react package includes full type definitions. All Igr* component props are typed, and DOM queries for the underlying web components are automatically typed via HTMLElementTagNameMap (provided by the igniteui-webcomponents peer 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 | null
  11. Optimize Ignite UI Web Components bundle size

    master

    To minimize application bundle size when using igniteui-webcomponents, follow these key principles:

    1. Avoid defineAllComponents(): This function imports all 60+ components, adding ~500KB+ to your bundle.
    2. Use defineComponents() with named imports: Import only the specific component classes you need to enable effective tree-shaking.
    3. Lazy load components: Load heavy components (like dialogs or modals) on demand rather than at application startup.
    4. 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);