ProductPromotion
Logo

Angular.JS

made by https://0x3d.site

GitHub - pierreavn/angular-tabler-icons: Tabler Icons components library for your Angular applications
Tabler Icons components library for your Angular applications - pierreavn/angular-tabler-icons
Visit Site

GitHub - pierreavn/angular-tabler-icons: Tabler Icons components library for your Angular applications

GitHub - pierreavn/angular-tabler-icons: Tabler Icons components library for your Angular applications

angular-tabler-icons

tabler-icons-version license downloads

Description

This package allows you to use the Tabler Icons in your angular applications. Tabler Icons is a set of free MIT-licensed high-quality SVG icons for you to use in your web projects. Each icon is designed on a 24x24 grid and a 2px stroke.

Inspired by angular-feather, thank you to the author.

Usage

1. Install the package

npm install angular-tabler-icons
# or
yarn add angular-tabler-icons

2. Generate a module to host the icons you'll import

ng generate module icons

3. Import assets

You need to import:

  • TablerIconsModule, as it contains the <i-tabler> component
  • The icons that you need

We put this in IconsModule for modularity. See example below:

file: icon.module.ts

import { NgModule } from '@angular/core';

import { TablerIconsModule } from 'angular-tabler-icons';
import { IconCamera, IconHeart, IconBrandGithub } from 'angular-tabler-icons/icons';

// Select some icons (use an object, not an array)
const icons = {
  IconCamera,
  IconHeart,
  IconBrandGithub
};

@NgModule({
  imports: [
    TablerIconsModule.pick(icons)
  ],
  exports: [
    TablerIconsModule
  ]
})
export class IconsModule { }

// NOTES:
// 1. We add TablerIconsModule to the 'exports', since the <i-tabler> component will be used in templates of parent module
// 2. Don't forget to pick some icons using TablerIconsModule.pick({ ... })

4. Import IconsModule

If you are using NgModules, import it this way:

import { NgModule } from "@angular/core";
import { MyComponent } from './my/my.component';
import { IconsModule } from "./icons.module";

@NgModule({
  declarations: [MyComponent],
  imports: [
    IconsModule, // <--- Here
  ],
})
export class MyModule {}

If you are using Standalone Components, import it this way:

import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterOutlet } from '@angular/router';
import { IconsModule } from './icons.module';

@Component({
  selector: 'app-my',
  standalone: true,
  imports: [CommonModule, RouterOutlet, IconsModule], // <--- Here
  templateUrl: './my.component.html',
  styleUrls: ['./my.component.scss']
})
export class MyComponent {}

5. Use it in template

After importing the IconsModule in your feature or shared module, use the icons as follows:

<i-tabler name="camera"></i-tabler>
<i-tabler name="heart" style="color: red;"></i-tabler>
<i-tabler name="heart-filled" style="color: red;"></i-tabler>
<i-tabler name="brand-github" class="someclass"></i-tabler>

Available icons

List of available icons: https://tabler.io/icons

This version includes Tabler Icons v3.1.0, see changelog to know which icons are available.

Styling icons

Each icon can be styled separately with CSS:

<i-tabler name="camera" class="big fill-red stroke-blue thin"></i-tabler>
.big {
  height: 50px;
  width: 50px;
}

.fill-red {
  fill: red;
}

.stroke-blue {
  color: blue;
}

.thin {
  stroke-width: 1px;
}

Options

Some options are available to configure the module:

import { environment } from '../environments/environment';
import { TablerIconsModule } from 'angular-tabler-icons';
import * as TablerIcons from 'angular-tabler-icons/icons';

@NgModule({
  imports: [
    TablerIconsModule.pick(TablerIcons, {

      // Ignore warnings, such as "Tabler Icon not found", for example:
      //   ignoreWarnings: environment.production,
      ignoreWarnings: true,

    })
  ],
  exports: [
    TablerIconsModule
  ]
})
export class IconsModule { }

Pick all icons

You can import all icons at once by doing the following. However, keep in mind that by doing this, all icons will end up in your application bundle. While this may not be much of an issue for prototyping, it is not recommended for any application that you plan to release.

import { TablerIconsModule } from 'angular-tabler-icons';
import * as TablerIcons from 'angular-tabler-icons/icons';

@NgModule({
  imports: [
    TablerIconsModule.pick(TablerIcons)
  ],
  exports: [
    TablerIconsModule
  ]
})
export class IconsModule { }

Angular version compatibility

Angular angular-tabler-icons
17 2.40.1+
16 2.21.1+
15 1.117.1+
14 1.72.1+
13 1.53.1+
12 1.41.3+
11 1.41.0+

Contributing

Feel free to report issues or to contibute to this project!
Here are few tips to start:

$ yarn lib:generate  # generate components from Tabler Icons
$ yarn lib:build  # build angular library

How to rebuild for newer tabler icons version

  1. Run GitHub actions workflow Automatic PR on Tabler Icons Release, with new Tabler Icons version (e.g. 2.40.0). This workflow will create automatically a new Pull Request.
  2. Approve and Merge the generated Pull Request.
  3. Create a release/tag with the new Tabler Icons version.

Package is automatically rebuilt and published, with the GitHub actions workflow Build and Publish package.

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory