Vite plugin to transform SVGs into React components. Latest version: 4.3.0, last published: 3 months ago. Start using vite-plugin-svgr in your project by running `npm i vite-plugin-svgr`. There are 339 other projects in the npm registry using vite-plugin
importLogofrom"./logo.svg?react"; If you are using TypeScript, there is also a declaration helper for better type inference. Add the following tovite-env.d.ts: /// <reference types="vite-plugin-svgr/client" /> Options svgr({// svgr options: https://react-svgr.com/docs/options/sv...
Then SVG files can be imported as React components, just likecreate-react-appdoes: import{ReactComponentasLogo}from'./logo.svg' If you are using TypeScript,vite-plugin-svgr/clientcan be added totsconfig.json: {// ..."compilerOptions": {// ..."types": ["vite-plugin-svgr/client"] ...
vite-plugin-svgr Vite plugin to transform SVGs into React components. Usessvgrunder the hood. Usage // vite.config.jsimportsvgrPluginfrom'vite-plugin-svgr'exportdefault{// ...plugins:[svgrPlugin({svgrOptions:{icon:true,// ...svgr options (https://react-svgr.com/docs/options/)},}...
// https://github.com/pd4d10/vite-plugin-svgr/pull/56 for preact compatiblility declare module '*.svg' { import * as React from 'react' declare module "*.svg" { import * as React from "react"; export const ReactComponent: React.FunctionComponent< React.ComponentProps<'svg'> & { ...
"@svgr/babel-plugin-add-jsx-attribute@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-7.0.0.tgz#80856c1b7a3b7422d232f6e079f0beb90c4a13e9" integrity sha512-khWbXesWIP9v8HuKCl2NU2HNAyqpSQ/vkIl36...
// https://github.com/pd4d10/vite-plugin-svgr/pull/56 for preact compatiblility declare module "*.svg" { declare module "*.svg?react" { import * as React from "react"; export const ReactComponent: React.FunctionComponent< const ReactComponent: React.FunctionComponent< React.ComponentProps...
pd4d10 / vite-plugin-svgr Public Notifications Fork 54 Star 554 Code Issues 34 Pull requests 4 Actions Projects Security Insights CommitsBranch selector main User selector mjpowersjr DatepickerAll time Commit History Commits on Aug 14, 2024 docs: add hint about vite-env.d.ts to ...
Add vite-plugin-svgr General ✏️ Mark the necessary items without changing the structure of the PR template. Pull request template structure not broken Type ℹ️ What types of changes does your...
Vite plugin to transform SVGs into React components - chore: remove unused files · pd4d10/vite-plugin-svgr@e6ff446