SVG Loader

Use nuxt-svgo-loader when you want to load optimized SVG files as Nuxt components.

For more detailed information, visit the Nuxt SVGO Loader documentation.

Installation

npx nuxi module add nuxt-svgo-loader

Configuration

nuxt.config.ts
export default defineNuxtConfig({
  modules: ['nuxt-svgo-loader'],
  svgoLoader: {
    // Options here will be passed to `vite-svg-loader`
  },
})

Usage

Example.vue
<template>
  <SvgoIcon name="nuxt" width="92" height="92" fill="#00DC82" />
</template>