1.0.1-beta.4 • Published 11 months ago
vite-plugin-icon v1.0.1-beta.4
mini-icons
It is more convenient to use svg as a component in jsx
Features
- ✅ Convenient you can use svg as a component in your jsx or tsx file
- ⚡ On-Demand transform only if you use the svg icon
- 💪 TypeScript
Usage
Use directly in your jsx file like below
import ReactLogo from './assets/react.svg'
import Boom from './assets/boom.svg'
function App() {
return (
<>
<ReactLogo style={{ width: 30, height: 30 }} />
<Boom style={{ width: 30, height: 30 }} />
</>
)
}
Install
npm i -D vite-plugin-icon import the plugin in vite
import Icons from 'vite-plugin-icon'
export default defineConfig({
plugins: [Icons()],
})
Plugin run steps
- genreate a
svg.d.ts
file - transform the svg to a jsx component
License
MIT License
1.0.1-beta.4
11 months ago
1.0.1-beta.3
11 months ago
1.0.1-beta.2
11 months ago
1.0.0-beta
11 months ago
0.0.1-alpha.0
12 months ago