
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
svg-icon-inline-loader
Advanced tools
Webpack loader to inline Material Design SVGs, Ionicon SVGs, Iconic SVGs, or any SVG file.
A webpack loader that enables inlining Material Design SVGs, Ionicon SVGs, Iconic SVGs, or any SVG file into HTML.
npm install --save-dev svg-icon-inline-loader
{
test: /\.html$/,
loader: 'svg-icon-inline'
},
Or with html-loader:
{
test: /\.html$/,
loader: 'html!svg-icon-inline'
},
This loader recognizes 3 types of self-closing tags:
<mat-svg/> - Inline a Material Design SVG<ion-svg/> - Inline an Ionicon SVG<iconic-svg/> - Inline an Iconic SVG<file-svg/> - Inline an SVG file.<mat-svg category="navigation" name="fullscreen_exit"/>
category: The category that Material Design specifies for that icon.name: The name of the icon. If the name is multi-word, it must be separated using underscores.<ion-svg name="ion-arrow-expand"/>
name: The name of the icon. If the name is multi-word, it must be separated using hyphens.<iconic-svg name="account-login"/>
name: The name of the icon. If the name is multi-word, it must be separated using hyphens.<file-svg src="./icons/home.svg"/>
src: The path of the svg file.Any attributes apart from category, name, or src, are retained. For example:
Input
<mat-svg v-if="displayHomeIcon" class="icon-home" category="action" name="home"/>
Output
<svg role="presentation" focusable="false" v-if="displayHomeIcon" class="icon-home" fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
<path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"></path>
<path d="M0 0h24v24H0z" fill="none"></path>
</svg>
A11y modifications for SVGs as recommended.
role="presentation" and focusable="false" attributes.desc and title attributes.SVGO is used to optimize SVGs.
Inlining SVGs enables CSS to be applied to SVGs.
Originally forked from markup-inline-loader. Thank you!
FAQs
Webpack loader to inline Material Design SVGs, Ionicon SVGs, Iconic SVGs, or any SVG file.
The npm package svg-icon-inline-loader receives a total of 86 weekly downloads. As such, svg-icon-inline-loader popularity was classified as not popular.
We found that svg-icon-inline-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.