Package Exports
- @coreui/icons-angular
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@coreui/icons-angular) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
CoreUI Icons Angular
c-icon
component
Angular component for CoreUI Icons SVG set.
Features
- Loads icons in three ways:
- stored globally in Angular service,
- directly passed SVG tag content,
- source link to SVG file
- Reduces icons bundle size when imported as single icons,
- Full functionality of
<svg>
html tag, - Clean API
For component description visit CIcon component documentation
Installation
If you already have installed CoreUI Angular component library plugin, then you have CIcon component already installed, otherwise install package by:
npm install @coreui/icons
npm install @coreui/icons-angular
Usage
// app NgModule
import { IconModule, IconSetModule, IconSetService } from '@coreui/icons-angular';
@NgModule({
imports: [
IconModule,
IconSetModule.forRoot(),
...
providers: [IconSetService],
...
// app component
import { cilEnvelopeOpen, flagSet } from '@coreui/icons';
import { IconModule, IconSetModule, IconSetService } from '@coreui/icons-angular';
@Component({
...
providers: [IconSetService],
...
})
export class AppComponent implements OnInit {
constructor(public iconSet: IconSetService) {
// iconSet singleton
iconSet.icons = { cilEnvelopeOpen, ...flagSet };
}
...
<c-icon name="cil-envelope-open" size="lg"></c-icon>
<c-icon name="cifAu"></c-icon>
API
Use one of
name
,src
orcontent
prop as it defines the way of icon import
proprerty | type | default | description |
---|---|---|---|
name |
string | undefined | name of SVG icon stored in IconSetService |
content |
string, string[] | undefined | SVG content |
src |
string | undefined | Link to the icon. If defined, component will be rendered as <img> tag |
size |
custom , custom-size , sm , lg , xl , 2xl , 3xl , 4xl , 5xl , 6xl , 7xl , 8xl , 9xl |
'' | Size of icon |
title |
string | undefined | |
use |
string | undefined | SVG <use> |
customClasses |
string | undefined | Replaces default c-icon component classes |
viewBox |
string | undefined | SVG viewbox |
attributes |
any | { role: 'img' } |
Object with additional html attributes |
width |
undefined | SVG width |
|
height |
undefined | SVG height |
License
CoreUI Icons Free are free, open source, and GPL friendly. You can use it for commercial projects, open source projects, or really almost whatever you want.
- Icons — CC BY 4.0 License
- In the CoreUI Icons Free download, the CC BY 4.0 license applies to all icons packaged as .svg and .js files types.
- Fonts — SIL OFL 1.1 License
- In the CoreUI Icons Free download, the SIL OLF license applies to all icons packaged as web and desktop font files.
- Code — MIT License
- In the CoreUI Icons Free download, the MIT license applies to all non-font and non-icon files.