Svg Use

screenshot of Svg Use
vite

Tools and bundler plugins, to ergonomically load SVG files via use[href]

Overview

The @svg-use library offers tools and bundler plugins to load SVG icons as components in JavaScript using SVG's <use href> mechanism. This method provides a performant way to reference SVG in components while considering themeing, portability, and ease of use.

Features

  • SVG Component Loading: Load SVG icons as components in JavaScript.
  • Bundler Integrations: Compatible with webpack, rollup, and vite bundler plugins.
  • Performance Optimization: Output components without inlining the SVG itself to avoid duplication and keep SVG size out of JS bundles.
  • Theming Support: Enables theming by including SVG inline to use HTML attributes and CSS selectors.
  • Portability: Allows loading SVG with ES modules, making it a suitable delivery mechanism for shareable libraries.
vite
Vite

Vite is a build tool that aims to provide a faster and leaner development experience for modern web projects

eslint
Eslint

ESLint is a linter for JavaScript that analyzes code to detect and report on potential problems and errors, as well as enforce consistent code style and best practices, helping developers to write cleaner, more maintainable code.

rollup
Rollup

RollupJS is a popular and efficient JavaScript module bundler that takes the code from multiple modules and packages them into a single optimized file, minimizing the overall size of the application and improving its performance.

typescript
Typescript

TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.

webpack
Webpack

Webpack is a popular open-source module bundler for JavaScript applications that bundles and optimizes the code and its dependencies for production-ready deployment. It can also be used to transform other types of assets such as CSS, images, and fonts.