Skip to content

Import all icons from a single type #64

Discussion options

You must be logged in to vote

Hi! Thank you very much, I'm glad you are finding it useful!

Yes, you can indeed, you just need to import using * from the package:

import * as ionicons from '@ng-icons/ionicons';

You then register the icons like this:

provideIcons(ionicons)

While convenient, be warned that icons individually imported to improve bundle size, importing all tabler icons will have an effect on you applications size:

A better way might be to have an single provideIcons at the root of your application when add all icons you are actually using there, that way you only have to import them once rather than in every component/ng module. This would help with reducing the bundle size.

Regardless, here is an example…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@juancarlosgzs
Comment options

@ashley-hunter
Comment options

Answer selected by juancarlosgzs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants