Phosphor Icons meets Nuxt
Documentation
If you are reading this, I want to take a moment to thank you for trying out this module ๐
Setup
Follow the following steps to start using this module:
- Add the
nuxt-phosphor-icons
module to your project as adevDependency
$ pnpm add -D nuxt-phosphor-icons
- Add the module to the
modules
section of thenuxt.config.ts
export default defineNuxtConfig({ devtools: { enabled: true }, modules: ["nuxt-phosphor-icons"], phosphor: {}, // Override module options, });
Congratulations ๐, you can now use any icon from @phosphor-icon/vue
in your Nuxt project!
Browse the available of icons here.
Before hurrying on now, lets go through some possible configuration you might want to do!
Configuration
You can configure the module using the phosphor
key in the nuxt.config.ts
Options
expose
- Default:
false
- Description: Enable to register components globally.
- Type:
Boolean
export default defineNuxtConfig({
phosphor: {
expose: true,
},
});
prefix
- Default:
phosphor-icon
orPhosphorIcon
- Description: The prefix of the component names.
- Type:
String
export default defineNuxtConfig({
phosphor: {
prefix: "your-prefix", // or YourPrefix
},
});
Note: if you have a multi word prefix, you should include a โ between the words.
showList
- Default:
true
- Description: Enable to generate a virtual file with the list of registered components at
#build/nuxt-phosphor-icons.json
- Type:
Boolean