All Projects → MoOx → React Svg Inline

MoOx / React Svg Inline

Licence: mit
DEPRECATED, I recommend you the tool SVGR

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Svg Inline

Vue Svg Inline Loader
Webpack loader used for inline replacement of SVG images with actual content of SVG files in Vue projects.
Stars: ✭ 105 (-54.35%)
Mutual labels:  webpack, svg, inline
Svgr
Transform SVGs into React components 🦁
Stars: ✭ 8,263 (+3492.61%)
Mutual labels:  webpack, svg
Vue Svg Loader
🔨 webpack loader that lets you use SVG files as Vue components
Stars: ✭ 514 (+123.48%)
Mutual labels:  webpack, svg
Conf
Landing page for event React Conf Brazil
Stars: ✭ 104 (-54.78%)
Mutual labels:  webpack, svg
Mojs
The motion graphics toolbelt for the web
Stars: ✭ 17,189 (+7373.48%)
Mutual labels:  webpack, svg
Svgpocketguide
All original content of A Pocket Guide to Writing SVG by Joni Trythall
Stars: ✭ 1,106 (+380.87%)
Mutual labels:  svg, inline
Vue D3 Workshop
Workshop content material and excercises for Suncoast Developers
Stars: ✭ 63 (-72.61%)
Mutual labels:  webpack, svg
Flowchart Vue
flowchart的vue版本
Stars: ✭ 136 (-40.87%)
Mutual labels:  webpack, svg
Svg Sprite Loader
Webpack loader for creating SVG sprites.
Stars: ✭ 1,822 (+692.17%)
Mutual labels:  webpack, svg
Webworkify Webpack
launch a web worker at runtime that can require() in the browser with webpack
Stars: ✭ 105 (-54.35%)
Mutual labels:  webpack, inline
Svg Spritemap Webpack Plugin
SVG spritemap plugin for webpack
Stars: ✭ 160 (-30.43%)
Mutual labels:  webpack, svg
Terminal In React
👨‍💻 A component that renders a terminal
Stars: ✭ 1,939 (+743.04%)
Mutual labels:  webpack, svg
React Sigma
Lightweight React library for drawing network graphs built on top of SigmaJS
Stars: ✭ 217 (-5.65%)
Mutual labels:  webpack, svg
Hard Source Webpack Plugin
www.npmjs.com/package/hard-source-webpack-plugin
Stars: ✭ 2,608 (+1033.91%)
Mutual labels:  webpack
React Starter Kit
React, Redux, Webpack, Material UI, Boostrap 4, Code Splitting, HMR
Stars: ✭ 229 (-0.43%)
Mutual labels:  webpack
Quark Electron
Quark is a cross-platform, integrated development environment for rapidly building - functional , prototypal projects, written in HTML, CSS and JavaScript with native desktop app like capabilities.
Stars: ✭ 224 (-2.61%)
Mutual labels:  webpack
Blockly Samples
Plugins, codelabs, and examples related to the Blockly library.
Stars: ✭ 222 (-3.48%)
Mutual labels:  webpack
Vue I18n Loader
🌐 vue-i18n loader for custom blocks
Stars: ✭ 229 (-0.43%)
Mutual labels:  webpack
Vue Admin
基于and-design-vue的vue后台管理系统模板
Stars: ✭ 226 (-1.74%)
Mutual labels:  webpack
Frontend Boilerplate
An ES20XX starter with common frontend tasks using Webpack 4 as module bundler and npm scripts as task runner.
Stars: ✭ 224 (-2.61%)
Mutual labels:  webpack

DEPRECATED, I recommend you the tool SVGR


react-svg-inline

Travis (Unix) Build Badge

A react component to clean and display raw SVGs.

Install

$ npm install react-svg-inline

You might also need to npm install raw-loader if you want to use this with webpack.

Usage

Here is an example of a usage in a React stateless component:

import React from "react"
import SVGInline from "react-svg-inline"

export default () => (
  <div>
    <SVGInline svg={"<svg....</svg>"} />
  </div>
)

Webpack to require() SVGs

Use the raw-loader to require() raw SVGs files and pass them to react-svg-inline.

module.exports = {
  loaders: [
    {
      test: /\.svg$/,
      loader: 'raw-loader'
    }
  ]
}

import React from "react"
import SVGInline from "react-svg-inline"
import iconSVG from "./myicon.svg"

export default () => (
  <div>
    <SVGInline svg={ iconSVG } />
  </div>
)

Options (props)

className

PropTypes.string

Class name used for the component that will wrap the SVG.

classSuffix

PropTypes.string

The class suffix that will be added to the svg className (default: "-svg").

component

PropTypes.oneOfType([ PropTypes.string, PropTypes.func, ]),

The component that will wrap the svg (default: span).

svg

PropTypes.string.isRequired

fill

PropTypes.string

Color to use

cleanup

PropTypes.oneOfType([ PropTypes.bool, PropTypes.array, ])

This allow you to cleanup (remove) some svg attributes. Here are the supported value that can be removed:

  • title
  • desc
  • comment
  • defs
  • width
  • height
  • fill
  • sketchMSShapeGroup
  • sketchMSPage
  • sketchMSLayerGroup

If cleanup === true, it will remove all the attributes above.

cleanupExceptions

PropTypes.array

This allow you to whitelist some svg attributes to keep while cleaning some others.

width

PropTypes.string

height

PropTypes.string

accessibilityLabel

PropTypes.string

This value is added as an svg <title> element that is accessible to screen readers. (Note: when this option is used, an SVG id attribute will be automatically injected).

accessibilityDesc

PropTypes.string

This value is added as an svg <desc> element that is accessible to screen readers.


CONTRIBUTING

  • ⇄ Pull requests and ★ Stars are always welcome.
  • For bugs and feature requests, please create an issue.
  • Pull requests must be accompanied by passing automated tests ($ npm test).

CHANGELOG

LICENSE

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].