Installations
npm install @zibuthe7j11/eius-atque-quidem
Developer Guide
BETA
Typescript
No
Module System
CommonJS
Node Version
20.12.2
NPM Version
10.5.0
Releases
3
Contributors
1
Unable to fetch Contributors
Languages
1
JavaScript
JavaScript (100%)
Developer
zibuthe7j11
Download Statistics
Total Downloads
99
Last Day
1
Last Week
3
Last Month
7
Last Year
99
GitHub Statistics
20 Commits
1 Branches
Package Meta Information
Latest Version
1.0.0
Package Id
@zibuthe7j11/eius-atque-quidem@1.0.0
Unpacked Size
12.94 kB
Size
5.49 kB
File Count
10
NPM Version
10.5.0
Node Version
20.12.2
Publised On
25 Apr 2024
Total Downloads
Cumulative downloads
Total Downloads
99
Last day
0%
1
Compared to previous day
Last week
0%
3
Compared to previous week
Last month
600%
7
Compared to previous month
Last year
0%
99
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Versions
@zibuthe7j11/eius-atque-quidem
This vite plugin generates a single SVG spritemap containing multiple .svg
files in a directory.
Features
- Easily generate the SVG spritemap as part of your build process
- Supports
<defs>
, so you can use gradients, patterns, and masks - Works with dev server 🔥
If you find this plugin useful, why not
Installation
1# using npm 2npm install -D @zibuthe7j11/eius-atque-quidem 3# using pnpm 4pnpm install -D @zibuthe7j11/eius-atque-quidem 5# using yarn 6yarn add --dev @zibuthe7j11/eius-atque-quidem
Usage
Vite config
1import { svgSpritemap } from '@zibuthe7j11/eius-atque-quidem';
2
3export default defineConfig({
4 plugins: [
5 svgSpritemap({
6 pattern: 'src/icons/*.svg',
7 }),
8 ],
9});
SVG element
1export const Icon: React.FC<{ name: string }> = ({ name }) => ( 2 <svg xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink"> 3 <use xlinkHref={`/spritemap.svg#${name}`} /> 4 </svg> 5); 6 7const App = () => { 8 return <Icon name="arrow" />; 9};
Options
Option | Type | Description |
---|---|---|
pattern | string | A glob pattern that specifies which SVG files to include in the sprite. |
prefix | string (optional) | A string that is added to the beginning of each SVG icon's ID when it is added to the sprite. |
filename | string (optional) | The name of the output file that contains the SVG sprite. Default is spritemap.svg . |
currentColor | boolean (optional) | Replace colors in the SVGs with the currentColor value by SVGO. Default is true . |
svgo | SVGOConfig or boolean (optional) | Use SVGO for optimization. Default is true . |
No vulnerabilities found.
No security vulnerabilities found.