#Iconify collection

10 messages · Page 1 of 1 (latest)

pulsar flickerBOT
#

Hi @turbid oyster. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Based on the knowledge sources provided, I can answer your question about the Iconify collection and locally installed icons in Nuxt UI.

Nuxt UI automatically installs the @nuxt/icon (https://github.com/nuxt/icon) module, which provides access to over 200,000 icons from the Iconify collection Getting-started > Modules (https://ui.nuxt.com/getting-started/installation#modules).

While it's possible to use any icon from the Iconify collection without installing them locally, it's highly recommended to install the icon collections you need locally. This is because locally installed icons can be served from your own server or serverless functions, which is faster and more reliable for both server-side rendering (SSR) and client-side rendering Getting-started > Icons (https://ui.nuxt.com/getting-started/theming#icons).

To install icon collections locally, you can use the following command:

pnpm i @iconify-json/{collection_name}

Given this information, it's not recommended to remove the locally installed icons that come with Nuxt UI. Keeping them installed locally provides better performance and reliability for your application.

If you're concerned about space or want to optimize your installation, instead of removing the icons, you should focus on installing only the specific icon collections you need for your project.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@turbid oyster Kapa.ai is still learning and improving, please let me know how I did by reacting below.

turbid oyster
#

@pulsar flicker i should keep icons even if i don't use them ?

pulsar flickerBOT
#

Let me check the knowledge base for you again. One moment! :books:

#

Based on the information provided in the knowledge sources, I can clarify this point for you.

It's not necessary to keep all the icons if you're not using them. The recommendation is to install only the specific icon collections that you need for your project. This approach optimizes your installation while maintaining the performance benefits of locally served icons.

As mentioned in the Getting-started > Icons (https://ui.nuxt.com/getting-started/theming#icons) section:

"It's highly recommended to install the icons collections you need locally with:

pnpm i @iconify-json/{collection_name}

For example, to use the i-uil-github icon, install its collection with @iconify-json/uil. This way the icons can be served locally or from your serverless functions, which is faster and more reliable on both SSR and client-side."

So, to answer your question directly: No, you don't need to keep icons you're not using. Instead, you should:

  1. Identify which icon collections you actually need for your project.
  2. Install only those specific collections locally.
  3. Remove any unused icon collections to optimize your project's size and performance.

This approach allows you to maintain the benefits of locally served icons for the ones you're actually using, without the overhead of unused icon sets.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@turbid oyster Kapa.ai is still learning and improving, please let me know how I did by reacting below.

turbid oyster
#

@pulsar flicker and how to remove / delete an icon collection ?

pulsar flickerBOT
#

Let me check the knowledge base for you again. One moment! :books:

#

To remove or delete an icon collection that you've installed locally in your Nuxt project, you can follow these steps:

  1. First, identify the package name of the icon collection you want to remove. It will typically be in the format @iconify-json/{collection_name}.

  2. Then, use your package manager to uninstall the collection. Depending on which package manager you're using, the command will be slightly different:

    For npm:

    npm uninstall @iconify-json/{collection_name}
    

    For yarn:

    yarn remove @iconify-json/{collection_name}
    

    For pnpm:

    pnpm remove @iconify-json/{collection_name}
    
  3. After uninstalling, it's a good practice to clean up any cached files. You can use the Nuxt cleanup command to remove common generated Nuxt files and caches:

    npx nuxi cleanup
    

    This command will remove directories like .nuxt, .output, node_modules/.vite, and node_modules/.cache as mentioned in the Nuxt documentation (https://nuxt.com/docs/api/commands/cleanup).

  4. Finally, make sure to update any parts of your code that were using the removed icon collection to avoid any errors.

Remember, removing an icon collection will mean that any icons from that collection will no longer be available locally. If you're still using any of these icons in your project, they will be fetched from the Iconify CDN instead, which might affect performance.

It's important to note that while the knowledge sources provide information on installing and using icon collections, they don't explicitly mention the process for removing them. The steps I've provided are based on standard package management practices and the Nuxt cleanup command documentation.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: