@nfq/svg-to-react
TypeScript icon, indicating that this package has built-in type declarations

3.0.3 • Public • Published

@nfq/svg-to-react

EsLint


  1. Description
  2. Getting started
    1. Installation
  3. Usage
  4. Props
  5. Support

Description: License: MIT

This project, @nfq/svg-to-react, is a powerful tool that allows you to convert SVG images into React components. It's built with Node.js and TypeScript. The main functionality of this package is to take a directory or a file of SVG images as input, and output a directory of React components. This is particularly useful for projects where SVG images are used extensively and need to be managed efficiently. The package provides a command line interface for easy use. It also supports different templates for generation, including 'typescript', 'jsdoc-typescript', and 'legacy'. This allows you to choose the format that best suits your project's needs.

(back to top)


Getting started

To the package follow the next steps:

Installation

To install the package run

npm install -g <Project name>

if you are on yarn

yarn add --global <Project name>

or on pnpm

pnpm install -g <Project name>

Usage

You can use this package to convert SVG files to React components. You can specify the input directory or file, the output directory, and the template to use for generation. The available templates are 'typescript', 'jsdoc-typescript', and 'legacy'.

For example, to convert all SVG files in the icons directory and output them as TypeScript React components in the components directory, you would use the following command:

svgToReact --src ./icons --out ./components --template typescript

(back to top)


Props

This package provides a command line interface with the following options:

  • src: The input directory or file.
  • out: The output directory.
  • template: The generation type. It has to be one of the following options: ['typescript', 'jsdoc-typescript', 'legacy'].

(back to top)


Support

Christoph Kruppe - [https://github.com/ckruppe] - c.kruppe@nfq.de

(back to top)

Readme

Keywords

none

Package Sidebar

Install

npm i @nfq/svg-to-react

Weekly Downloads

1

Version

3.0.3

License

MIT

Unpacked Size

197 kB

Total Files

19

Last publish

Collaborators

  • nfqdbt