Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
dfx-bootstrap-icons
Advanced tools
Straightforward, state-of-the-art Angular icon library. Build upon the excellence of Bootstrap Icons providing you with over 2,000 icons in a bundle-size friendly way.
Straightforward, state-of-the-art Angular icon library.
Build upon the excellence of Bootstrap Icons providing you with over 2,000 icons in a bundle-size friendly way.
Angular | dfx-bootstrap-icons |
---|---|
17.x.x | 1.x.x |
npm install dfx-bootstrap-icons
pnpm install dfx-bootstrap-icons
import { BiComponent, provideBi, withIcons, exclamationOctagonFill, xCircleFill } from 'dfx-bootstrap-icons';
@Component({
standalone: true,
selector: 'app-root',
template: ` <bi name="exclamation-octagon-fill" /> `,
imports: [BiComponent],
providers: [provideBi(withIcons({ exclamationOctagonFill }))],
})
export class AppComponent {}
import { BiModule, withIcons, exclamationOctagonFill } from 'dfx-bootstrap-icons';
@NgModule({
declaration: [AppComponent],
imports: [BiModule.setup(withIcons({ exclamationOctagonFill }))],
})
export class AppModule {}
@Component({
selector: 'app-root',
template: ` <bi name="exclamation-octagon-fill" /> `,
})
export class AppComponent {}
import { provideBi, BiComponent, withIcons, withWidth, withHeight, withColor, exclamationOctagonFill } from 'dfx-bootstrap-icons';
@Component({
// ...
standalone: true,
imports: [BiComponent],
providers: [provideBi(withIcons({ exclamationOctagonFill }), withWidth(16), withHeight(16), withColor('currentColor'))],
template: ` <bi name="exclamation-octagon-fill" /> `,
// ...
})
export class AppComponent {}
import { BiModule, withIcons, withWidth, withHeight, withColor, exclamationOctagonFill } from 'dfx-bootstrap-icons';
@NgModule({
declaration: [AppComponent],
imports: [BiModule.setup(withIcons({ exclamationOctagonFill }), withWidth(16), withHeight(16), withColor('currentColor'))],
})
export class AppModule {}
Name | Type | Description | Example |
---|---|---|---|
withIcons | { [key: string]: string } | Icons you want to include in your bundle. | withIcons({ exclamationOctagonFill, xCircleFill }) |
withCDN | ...string[] | Name of the icon. | withCDN('https://playground.dafnik.me/bootstrap-icons/icons') |
withWidth | string | Width of the icon. | withWidth('24') |
withHeight | string | Height of the icon. | withHeight('24') |
withColor | string | Color of the icon. | withColor('#0000FF') |
@Component({
// ...
selector: 'app-root',
template: ` <bi name="exclamation-octagon-fill" width="16" height="16" color="currentColor" clearDimensions="false" ariaLabel="Icon" /> `,
// ...
})
export class AppComponent {}
Name | Type | Description | Default value |
---|---|---|---|
name | BiName | BiNamesEnum | Name of the icon. | |
width | string | Width of the icon. | 16 |
height | string | Height of the icon. | 16 |
color | string | Color of the icon. | currentColor |
clearDimensions | boolean | Clears dimensions (width, height) set via config. | false |
ariaLabel | string | aria-label which is set on the icon. | undefined |
You are not required to include every used icon in your bundle. Instead, you have the option to utilize a CDN URL, allowing you to load your icons dynamically at runtime, either exclusively or in addition to bundling them.
When providing multiple URLs, dfx-bootstrap-icons is going to pick a single one randomly at app start.
Configure a pool of CDN URLs:
import { provideBi, withCDN } from 'dfx-bootstrap-icons';
bootstrapApplication(AppComponent, {
providers: [provideBi(withCDN('https://playground.dafnik.me/bootstrap-icons/icons', 'https://test.url.at'))],
}).catch((err) => console.error(err));
Don't forget to add the HttpClient
and biCacheInterceptor
When using CDNs you can use the biCacheInterceptor
to prevent the duplicate fetching of icons.
import { biCacheInterceptor } from 'dfx-bootstrap-icons';
import { provideHttpClient, withInterceptors } from '@angular/common/http';
providers: [provideHttpClient(withInterceptors([biCacheInterceptor]))];
// icons.ts
import {
apple,
// Import more icons
} from 'dfx-bootstrap-icons';
export const ICONS = {
apple,
// Import more icons
};
// main.ts
import { bootstrapApplication } from '@angular/platform-browser';
import { provideBi, withIcons } from 'dfx-bootstrap-icons';
import { AppComponent } from './app/app.component';
import { ICONS } from './app/icons.ts';
bootstrapApplication(AppComponent, {
providers: [provideBi(withIcons(ICONS))],
}).catch((err) => console.error(err));
import { provideBi, withIcons, allIcons } from 'dfx-bootstrap-icons';
bootstrapApplication(AppComponent, {
providers: [provideBi(withIcons(allIcons))],
}).catch((err) => console.error(err));
By Dafnik
FAQs
Straightforward, state-of-the-art Angular icon library. Build upon the excellence of Bootstrap Icons providing you with over 2,000 icons in a bundle-size friendly way.
We found that dfx-bootstrap-icons demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.