All Projects β†’ necinc β†’ Msvgc

necinc / Msvgc

Make React components from your plain SVG files

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Msvgc

Pixo
Convert SVG icons into React components
Stars: ✭ 371 (+479.69%)
Mutual labels:  cli, svg, components
Create Component App
Tool to generate different types of React components from the terminal. πŸ’»
Stars: ✭ 879 (+1273.44%)
Mutual labels:  cli, components, react-components
Malvid
UI to help you build and document web components.
Stars: ✭ 347 (+442.19%)
Mutual labels:  cli, components
Awesome Ui Component Library
Curated list of framework component libraries for UI styles/toolkit
Stars: ✭ 702 (+996.88%)
Mutual labels:  components, react-components
Svgexport
SVG to PNG/JPEG command-line tool and Node.js module
Stars: ✭ 731 (+1042.19%)
Mutual labels:  cli, svg
Reactackle
Open-source components library built with React and Styled-Components.
Stars: ✭ 278 (+334.38%)
Mutual labels:  components, react-components
Svgo
βš™οΈ Node.js tool for optimizing SVG files
Stars: ✭ 17,050 (+26540.63%)
Mutual labels:  cli, svg
Radiance
Building modern, elegant and fast Swing applications
Stars: ✭ 458 (+615.63%)
Mutual labels:  svg, components
React Inlinesvg
An SVG loader component for ReactJS
Stars: ✭ 952 (+1387.5%)
Mutual labels:  svg, react-components
React Components
React components
Stars: ✭ 47 (-26.56%)
Mutual labels:  components, react-components
Flawwwless Ui
Flawwwless ui library for React.js.
Stars: ✭ 265 (+314.06%)
Mutual labels:  components, react-components
Deep Viz
A React component library, providing concise and beautiful diversity charts with Canvas, SVG, E-map, WebGL, Dom, based on data visualization experience and commercial data display practice.
Stars: ✭ 55 (-14.06%)
Mutual labels:  svg, react-components
React Weui
weui for react
Stars: ✭ 2,793 (+4264.06%)
Mutual labels:  components, react-components
Chakra Ui
⚑️Simple, Modular & Accessible UI Components for your React Applications
Stars: ✭ 295 (+360.94%)
Mutual labels:  components, react-components
furl
Functional react.js components.
Stars: ✭ 33 (-48.44%)
Mutual labels:  components, react-components
engage-ui
Engage UI is a React component library designed to help developers and designers creater the delightful web experiences.
Stars: ✭ 14 (-78.12%)
Mutual labels:  components, react-components
NE-Component
A react component library.
Stars: ✭ 29 (-54.69%)
Mutual labels:  components, react-components
tailwind-antd-react-kit
UI Components and helpers for frontend development using Tailwind + Ant Design and React.js
Stars: ✭ 27 (-57.81%)
Mutual labels:  components, react-components
Element
Programmatic UI for macOS
Stars: ✭ 855 (+1235.94%)
Mutual labels:  svg, components
Textusm
Online tool for Generate a User Story Map from indented text.
Stars: ✭ 49 (-23.44%)
Mutual labels:  cli, svg

MSVGC

Utils for generating react components from plain svg files
(compatible with react-native)

Install:

# install package globally
npm install -g msvgc

Usage:

# provide for utils
msvgc -f ./path/to/pic.svg -o ./svgComponents/

--camelCase flag creates components with camel-case class names

--react-native flag creates components using react-native-svg library

--color flag creates react-native components with color props passed to the svg children's fill prop

--typescript flag will use typescript import statements e.g. (import * as React)

--coffeescript flag will use CoffeeScript CJSX syntax for creating components

Notes:

If default params are not set, the current working directory will be used as the path to .svg files with output in the ./svg directory.

Subdirectories containing .svg files will generate their corresponding react components within a subdirectory in the output path.

The output path contains an index.js that exports all generated components.

React JS:

Use generated components in your jsx/tsx/cjsx files:

[...]

import Pic from './svgComponents/Pic'

class MyComponent extends Component {
  render() {
    return (
      <div>
        <Pic width={300} height={100} />
        <p>Lorem ipsum...</p>
      </div>
    );
  }
}

[...]

TODO:

  • [x] Create index file in target component directory.
    • [ ] Provide warning when duplicate component names exist in the index.
  • [ ] Compare existing files in target component directory.
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].