[!IMPORTANT]
This repository is now deprecated in favor of
unplugin-svg-transformer
, the successor ofnuxt-svg-transformer
. Please consider to useunplugin-svg-transformer
instead.
A Nuxt 3 module to manage SVG as icons, transform SVG to inject dynamically into Vue component, type included.
SvgIcon
style
and class
global attributesname
prop (typescript
required)unplugin-svg-transformer
Breaking changes:
unplugin
fallback
option is now string
componentName
removed (SvgIcon
is now the default for Vue/Nuxt/React components)assetsDir
is now svgDir
and should contains only your SVG fileslazy
removedlog
is now warning
display
removed, use svg
group inlineStyleDefault
insteadreactive
removed, use reactive
prop on Vue/Nuxt component instead (React component is always reactive)svg
group classDefault
, clearClass
, clearSize
, clearStyle
, sizeInherit
, inlineStyleDefault
, title
, currentColor
styleDefault
is now inlineStyle
into svg
groupinlineStyle
is now inlineStyleDefault
classDefault
and inlineStyleDefault
are now string[]
This documentation offer to install unplugin-svg-transformer
instead nuxt-svg-transformer
(deprecated), you can use the same options.
npm i unplugin-svg-transformer --save-dev
# or
yarn add unplugin-svg-transformer --dev
# or
pnpm add unplugin-svg-transformer -D
Add it to nuxt.config.ts
:
export default defineNuxtConfig({
modules: [
"unplugin-svg-transformer/nuxt", // https://github.com/kiwilan/unplugin-svg-transformer
],
svgTransformer: {
// Options
},
});
See documentation.
MIT - Made with π