Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

ngx-bootstrap-icons

avmaisak14.1kMIT1.9.3TypeScript support: included

Bootstrap Icons components library for your Angular Applications

angular2, angular, ngx, bootstrap, bootstrap-icons, twbs-icons, twbs, icons, svg, ui, components, library

readme

Bootstrap logo

ngx-bootstrap-icons

This Angular module allows you to use the Bootstrap Icons in your angular application without additional dependencies.


GitHub issues GitHub license GitHub stars npm version Package Quality Bootstrap logo

npm i ngx-bootstrap-icons --save

Bootstrap Icons full set

Demo

Demo Here

Usage

1. Install the package

npm i ngx-bootstrap-icons --save

2. Import module

import { NgxBootstrapIconsModule } from 'ngx-bootstrap-icons';

3. Import assets

You can import all icons (not recomended) or each icon individually.

3.1 Import all icons
import { allIcons } from 'ngx-bootstrap-icons';
3.2 Import some icons
import { alarm, alarmFill, alignBottom } from 'ngx-bootstrap-icons';
// Select some icons (use an object, not an array)
const icons = {
  alarm,
  alarmFill,
  alignBottom
};

4. Import Module (all icons)

import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    NgxBootstrapIconsModule.pick(allIcons)
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
4.1. Import Module (some icons)
import { NgxBootstrapIconsModule } from 'ngx-bootstrap-icons';
import { alarm, alarmFill, alignBottom } from 'ngx-bootstrap-icons';

// Select some icons (use an object, not an array)
const icons = {
  alarm,
  alarmFill,
  alignBottom
};

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    NgxBootstrapIconsModule.pick(icons)
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

/**

Another way.
--------------

Import NgxBootstrapIconsModule.pick(icons) inside of the AppModule

Import NgxBootstrapIconsModule (without the pick() method) inside of any FeatureModule where will be used.

Now you can import icons in one place only (root module) and successfully use the component anywhere you want.

**/
4.2. Configure Module (optional)
import { NgxBootstrapIconsModule, ColorTheme } from 'ngx-bootstrap-icons';
import { alarm, alarmFill, alignBottom } from 'ngx-bootstrap-icons';

// Select some icons (use an object, not an array)
const icons = {
  alarm,
  alarmFill,
  alignBottom
};

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    NgxBootstrapIconsModule.pick(icons, { 
        width: '2em', 
        height: '2em', 
        theme: ColorTheme.Danger,
    })
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
Configure options
Name of input prarameter Type Required Default Value Description
width string false null icon default width
height string false null icon default height
theme enum false null default color theme

5. Use it in template

<i-bs name="alarm-fill"></i-bs>

or (with your preffered tag)

<i i-bs name="alarm-fill"></i>

or optionally use our enums for autocomplete support

import { iconNamesEnum } from 'ngx-bootstrap-icons';

public iconNames = iconNamesEnum;

<i-bs [name]="iconNames.AlarmFill"></i-bs>

Also you can use width and height for icon (By default width and height are 1rem)

<i-bs 
  name="alarm-fill" 
  width="2rem" 
  height="2rem">
</i-bs>
<i
  i-bs 
  name="alarm-fill" 
  width="2rem" 
  height="2rem">
</i>

6. Input parameters

Name of input prarameter Type Required Default Value Description
name string true null name of the icon
width string false null width of the icon. Default value used from svg
height string false null height of the icon. Default value used from svg
resetDefaultDimensions boolean false false if this parameter is set, default dimensions of the svg icon will be removed

changelog

ChangeLog

v.1.0.0 (28.08.2020)

  • Added changelog
  • Updated bs-icons to version 1.0.0
  • Angular package updates up to 10.0.14
  • Updated Angular peer Dependencies up to 10.0.14
  • engines - npm up to 6.14.6

v.1.1.0 (20.10.2020)

  • 28.08.2020 - Updated Demo Page to 1.0.0 version
  • 28.08.2020 - Updated meta tags, favicons to demopage
  • 03.09.2020 - Updated Angular peer Dependencies up to 10.1.0
  • 29.08.2020 - move logo to header
  • 17.09.2020 - Added ngx-clipboard v 13.0.1
  • 17.09.2020 - Added copy to clipboard button
  • 17.09.2020 - Buttons show on hover
  • 20.09.2020 - Updated typescript 4.0.2 → 4.0.3
  • 21.09.2020 - Updated jasmine-spec-reporter 5.0.2 → 6.0.0
  • 27.09.2020 - Updated karma 5.2.2 → 5.2.3, ng-packagr 10.1.0 → 10.1.2
  • 29.09.2020 - Updated cover image in readme
  • 15.10.2020 - Updated to angular 10.1.6, Updated bootstrap to 4.5.3, updated demo
  • 19.10.2020 - updated: eslint-config-airbnb-typescript to 12.0.0,engines: node >= 12.19,npm >=6.14.8, small refactorings in generator script
  • 20.10.2020 - Fix some broken icons - Fixes #423: Update arrow-up-square-fil - Fixes #415: Properly name grip-horizontal and grip-vertical, make file-earmark variations consistent

v.1.2.0 (21.10.2020)

  • [demo] - Updated angular to 10.2.0
  • [demo] - Updated @types/node to 14.14.1
  • [icons] - Added Word, Excel, PowerPoint, and bar chart icons. Also adds two journal bookmark icons.
  • [icons] - Add two new eomjis, plus fill variations for all
  • [icons] - Fixes #437: make file-earmark variations consistent
  • [icons] - Fixes #423: Update arrow-up-square-fil
  • [icons] - Fixes #415: Properly name grip-horizontal and grip-vertical
  • [icons] - Updated to v.1.1.0, fixed #42

v.1.2.2 (21.10.2020)

  • [icons] - fixed #47

v.1.2.3 (18.11.2020)

  • [icons] - fixed #57 (Added enums for icons) (thank you, @tayambamwanza for contributing)
  • [icons] - fixed #65
  • [readme] - minor Readme impovements (thank you, @tayambamwanza for contributing)

v.1.2.4 (12.12.2020)

  • [icons] - fixed #121 (updated Bootstrap Icons to v1.2.0 )

v.1.3.0 (13.12.2020)

  • [icons] - updated Bootstrap Icons to v1.2.1
  • [icons] - fixed some linter errors
  • [icons] - breaking changes - all icons now camelCase

v.1.3.1 (14.12.2020)

  • [breaking changes] - fixed #126
  • fixed #127

v.1.3.2 (4.01.2021)

  • fixed #153 - icons v1.2.2

v.1.3.3 (9.01.2021)

  • fixed #175 - icons v1.3.0

    v.1.3.4 (15.01.2021)

  • fixed #182, #54

v.1.3.5 (02.02.2021)

  • fixed #222, added config options for module,
  • [breaking changes] - pick() changed forRoot()

v.1.3.6 (23.02.2021)

  • Updated to 1.4.0
  • fixed #253, added config options for module,
  • [breaking changes] - reverted to pick() method

v.1.4.0 (01.03.2021)

  • Sync version with bootstrap-icons

v.1.4.1 (24.03.2021)

  • bootstrap icons - Update mic and record icons to prevent fill rule issues (#815)
  • bootstrap icons - Update mic icons to prevent fill rule issues
  • bootstrap icons - Fixes #673: Fix fill-rule on record icon
  • lib peer dependencies changed to lodash instead camelcase

v.1.4.2 (28.03.2021)

  • bootstrap icons - Change PowerPoint icons to capitalize the P
  • bootstrap icons - Update skip-forward and skip-backward icons to fix their names

v.1.4.3 (29.03.2021)

  • bootstrap icons - Update icons after the svgo update
  • bootstrap icons - Re-run icons script after fresh export from Figma

v.1.4.4 (30.03.2021)

  • bootstrap icons - updated to 1.4.1

v.1.4.5 (30.03.2021)

  • fixed - #357

v.1.4.6 (18.04.2021)

  • removed unneeded packages
  • engines.node updated to 14 LTS
  • engines.npm updated to 6.14.12
  • removed lodash.camelcase peer dependency
  • added own camelcase function
  • icon can be used like directive with your preffred tag
  • fixed ColorTheme naming enum file
  • demo now uses local library paths
  • fixed #381

v.1.5.0 (01.05.2021)

  • Add 45 new icons for v1.5.0
  • Updated figma link in readme

v.1.5.1 (12.07.2021)

  • fixed #540 (thanks to @tayambamwanza)

v.1.5.2 (15.07.2021)

  • fixed #545