Skip to content

silverwind/react-svg-raw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-svg-raw

React Component for wrapper-less inline SVGs

Unlike other modules, this module will not create a wrapper element around the SVG but instead render it as-is.

Every prop on the component except src will be copied to the resulting SVG. No effort on post-processing the SVG is taken by this module.

Install

$ npm i react-svg-raw

Usage

import React from "react";
import SVG from "react-svg-raw";

export default () => (
  <main>
    <SVG src={"<svg></svg>"}/>
  </main>
)

© silverwind, distributed under BSD licence