Skip to content

benistary/gatsby-plugin-svg-sprite

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gatsby-plugin-svg-sprite

npm version dependencies Status

svg-sprite plugin for Gatsby

Table of contents

Installation

Install gatsby-plugin-svg-sprite via npm.

npm install gatsby-plugin-svg-sprite --save

Add gatsby-plugin-svg-sprite to your plugins in gatsby-config.js.

module.exports = {
  plugins: [
    'gatsby-plugin-svg-sprite',
  ],
};

Usage

import twitterIcon from './path/to/twitter.svg';

const Icon = () => (
  <svg>
    <use xlinkHref={`#${twitterIcon.id}`} />
  </svg>
);

License

MIT License

Copyright (c) 2018 Marco Biedermann

About

svg-sprite plugin for Gatsby

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%