Taiga UI

repository·main·Indexed 11 days ago

https://github.com/taiga-family/taiga-ui

A modular, tree-shakable Angular UI Kit designed for high performance and deep customization using CSS custom properties. Version 5.19.0 supports Angular ^19.0.0. It consists of base libraries like @taiga-ui/core, @taiga-ui/cdk, and @taiga-ui/kit, along with specialized addons for charts, commerce, mobile, tables, and documentation portals.

Tokens
70.3K
Snippets
207
Records
435
Agent score
88%

What's inside Taiga UI

  1. Overview of Taiga UI

    main

    Taiga UI is a fully-treeshakable Angular UI Kit composed of multiple base libraries and various add-ons. It is designed to be modular, agnostic, and highly customizable.

    Key Features

    • Modular & Treeshakable: Uses Secondary Entry Points to ensure that importing a single entity does not include redundant code in your bundle.
    • Agnostic Design: Components are flexible for various use cases while maintaining high-quality UX standards.
    • Customizable Styling: Uses CSS custom properties for styling and provides built-in support for dark themes.
    • High Performance: Built with strict TypeScript mode and all components use OnPush change detection.
    • Dynamic Content: Based on the ng-polymorpheus dynamic content approach and utilizes Web APIs for Angular.
  2. What is Taiga UI CDK?

    main
    The @taiga-ui/cdk is a development kit consisting of low-level tools and abstractions used to build Taiga UI Angular entities. It is a core component of the larger Taiga UI ecosystem, which is a fully-treeshakable Angular UI Kit composed of multiple base libraries and add-ons.
  3. Use correct types for event handlers and CDK

    main

    Taiga UI relies on specific types for its API and CDK. Avoid using native DOM or JavaScript types where Taiga UI types are expected:

    • Event Handlers: Use the specific Taiga UI type emitted by the component's output (e.g., TuiDay, TuiDayRange) instead of the standard DOM Event type. Always check the component's API - Outputs section for the exact type.
    • Date/Time Values: Use Taiga UI CDK types such as TuiDay, TuiMonth, or TuiTime instead of native Date objects or plain numbers. These types are imported from @taiga-ui/cdk.
  4. Understand Taiga UI tree-shaking

    main
    Taiga UI is designed to be fully tree-shakable. You can import individual entities (components, directives, pipes, etc.) from the library without including the entire library in your production bundle. This ensures that only the code you actually use is shipped to your users.
  5. Install Taiga UI Kit

    main

    To use the main set of components for building Taiga UI based Angular applications, install the core packages using npm. It is recommended to install @taiga-ui/cdk, @taiga-ui/core, and @taiga-ui/kit together to ensure all necessary base libraries are available.

    npm i @taiga-ui/{cdk,core,kit}
  6. Configure routing for documentation pages

    main

    When defining routes for your documentation pages, you must include a title in the route data object. This title is required for the TUI_DOC_SEE_ALSO feature to work and is automatically used to update the browser tab title via TUI_DOC_TITLE during navigation.

    import {Routes} from '@angular/router';
    
    const appRoutes: Routes = [
      {
        path: 'doc-page-1',
        loadComponent: async () => (await import('../doc-page-1')).DocPage,
        data: {
          title: 'Documentation page #1',
        },
      },
    ];
  7. Install @taiga-ui/layout

    main

    To use the layout components, you must first install the base Taiga UI packages (@taiga-ui/cdk and @taiga-ui/core) and then install the @taiga-ui/layout package itself.

    Taiga UI is designed to be fully tree-shakable. You can import individual entities (components, directives, etc.) to ensure your final bundle only contains the code you actually use, rather than the entire library.

    # Install base packages
    npm i @taiga-ui/{cdk,core}
    
    # Install layout package
    npm i @taiga-ui/layout
  8. Install @taiga-ui/experimental

    main

    To use the experimental components, you must first install the required base packages (@taiga-ui/cdk and @taiga-ui/core) and then install the experimental package itself.

    Note that Taiga UI is fully tree-shakable; you can import individual entities to ensure your bundle only contains the code you actually use.

    npm i @taiga-ui/{cdk,core}
    npm i @taiga-ui/experimental