tabler-icons/packages/icons-angular
codecalm a4e8cd6a44 Add ChangeDetectionStrategy to TablerIconComponent for optimized rendering 2025-12-24 01:07:06 +01:00
..
src Add ChangeDetectionStrategy to TablerIconComponent for optimized rendering 2025-12-24 01:07:06 +01:00
.gitignore Add icons-angular package (v0.0.0-alpha) 2024-04-12 21:51:43 +02:00
README.md Refactor TablerIconComponent to use Angular's dependency injection for improved readability and maintainability, enhance error handling for icon input, and update README links for accuracy. Remove unnecessary paths from TypeScript configuration. 2025-12-24 00:57:52 +01:00
angular.json Update TypeScript version and Angular dependencies in icons-angular package 2025-12-23 23:56:00 +01:00
build.mjs Upgrade Angular dependencies to version 21, update TypeScript configuration, and enhance icon imports in the icons-angular package for improved module resolution and clarity. 2025-12-24 00:37:23 +01:00
karma.conf.js Add icons-angular package (v0.0.0-alpha) 2024-04-12 21:51:43 +02:00
ng-package.json Update TypeScript version and Angular dependencies in icons-angular package 2025-12-23 23:56:00 +01:00
package.json Refactor icons-angular package configuration by removing exports from package.json, adding type exports in public-api.ts, and updating TypeScript configuration to skip library checks and exclude spec files for cleaner builds. 2025-12-24 00:52:02 +01:00
tsconfig.json Refactor TablerIconComponent to use Angular's dependency injection for improved readability and maintainability, enhance error handling for icon input, and update README links for accuracy. Remove unnecessary paths from TypeScript configuration. 2025-12-24 00:57:52 +01:00
tsconfig.lib.json Refactor clean scripts in package.json files to use find with -delete for improved performance and clarity 2025-12-24 00:15:24 +01:00
tsconfig.lib.prod.json Refactor clean scripts in package.json files to use find with -delete for improved performance and clarity 2025-12-24 00:15:24 +01:00
tsconfig.spec.json Refactor clean scripts in package.json files to use find with -delete for improved performance and clarity 2025-12-24 00:15:24 +01:00

README.md

Tabler Icons for Angular

Tabler Icons

Implementation of the Tabler Icons library for Angular applications.

Browse all icons at tabler.io →

Latest Release License

Sponsors

If you want to support our project and help us grow it, you can become a sponsor on GitHub or just donate on PayPal :)

Prerequisites

The minimal supported version of Angular is 16.0.0.

Installation

yarn add @tabler/icons-angular

or

npm install @tabler/icons-angular

or

pnpm install @tabler/icons-angular

How to use

It's build with ESmodules so it's tree-shakable. You decide which icons to include.

You can include icons by providing them with TablerIconModule or by importing TablerIcon objects in a single component.

I. Using the provider

1a. Import with NgModules

In a module in which the icons are needed or in a main module

import { TablerIconComponent, TablerIconModule, IconBrandAngular, IconHome } from '@tabler/icons-angular';

@NgModule({
  imports: [TablerIconModule.pick({ IconBrandAngular, IconHome }), TablerIconComponent]
  // other configuration
})
export class AppModule { }

1b. Import without NgModules

In main.ts

import { TablerIconModule, IconBrandAngular } from '@tabler/icons-angular';

bootstrapApplication(AppComponent, {
  providers: [
    importProvidersFrom(TablerIconModule.pick({ IconBrandAngular }))
  ]
})

or in a route configuration

import { IconBrandAngular, TablerIconModule } from '@tabler/icons-angular';

export const routes: Routes = [
  {
    path: 'demo',
    component: DemoComponent,
    providers: [importProvidersFrom(TablerIconModule.pick({ IconBrandAngular }))]
  }
];

In a standalone component which needs a TablerIconComponent

import { TablerIconComponent } from '@tabler/icons-angular';

@Component({
  imports: [TablerIconComponent],
  standalone: true,
  // other configuration
})
export class DemoComponent { }

2. Use an icon component in a template

<tabler-icon icon="icon-brand-angular"></tabler-icon>
<tabler-icon icon="brand-angular"></tabler-icon>

II. Importing an icon object

1a. Import with NgModules

In a module in which the icons are needed or in a main module:

import { TablerIconComponent, TablerIconModule } from '@tabler/icons-angular';

@NgModule({
  imports: [TablerIconModule, TablerIconComponent]
  // other configuration
})
export class AppModule { }

1b. Import in a standalone component

import { TablerIconComponent, IconBrandAngular } from '@tabler/icons-angular';

@Component({
  imports: [TablerIconComponent],
  standalone: true,
  // other configuration
})
export class AppComponent {
  iconBrandAngular = IconBrandAngular;
}

2. Use an icon component in a template

<tabler-icon [icon]="iconBrandAngular"></tabler-icon>

Props

name type default
size number 24
color string currentColor
stroke number 2
<tabler-icon icon="brand-angular" [size]="48" color="blue" [stroke]="1.75" class="my-icon"></tabler-icon>

Global configuration

If you want to change default property values globally you can overwrite TablerIconConfig using providers. You are able to set all three properties or just some of them.

{
  provide: TablerIconConfig, useValue: {
    size: 40,
    stroke: 1,
    color: 'blue'
  }
}
{ provide: TablerIconConfig, useValue: { size: 40 } }

Loading all icons

There is also a possibility to import all icons at once but this can cause a significant growth of your application build size.

import { icons, TablerIconComponent, TablerIconModule } from '@tabler/icons-angular';

@NgModule({
  imports: [TablerIconModule.pick(icons), TablerIconComponent],
  // other configuration
})
export class AppModule {}

Contributing

For more info on how to contribute please see the contribution guidelines.

Caught a mistake or want to contribute to the documentation? Edit this page on Github

License

Tabler Icons is licensed under the MIT License.

Sponsor Tabler

Sponsor Tabler