Phosphor Icons meets Nuxt
Documentation
:-P An easier way of using @phosphor-icons/vue in your Nuxt project!
Setup
Run the following command to install and add the module to your project:
$ pnpm dlx nuxi@latest module add nuxt-phosphor-icons
Aside: I know I'm being preferential in my choice of package managers
Congratulations ๐, you can now browse @phosphor-icons/vue for icons to use in your project!
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
export default defineNuxtConfig({
phosphor: {
showList: true,
},
});