Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@svgr/cli

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@svgr/cli

SVGR command line.

  • 4.3.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
361K
increased by2.82%
Maintainers
1
Weekly downloads
 
Created

What is @svgr/cli?

@svgr/cli is a command-line tool that allows you to transform SVG files into React components. It provides a simple and efficient way to integrate SVGs into your React applications, offering various customization options and optimizations.

What are @svgr/cli's main functionalities?

Convert SVG to React Component

This command converts an SVG file into a React component and saves it in the specified output directory. It simplifies the process of using SVGs in React applications by automating the conversion.

npx @svgr/cli path/to/icon.svg --out-dir src/components

Optimize SVG

This command not only converts the SVG to a React component but also optimizes the SVG using SVGO (SVG Optimizer) with a custom configuration file. This helps in reducing the file size and improving performance.

npx @svgr/cli path/to/icon.svg --out-dir src/components --svgo-config ./svgo.config.js

Custom Template

This command allows you to use a custom template for generating the React component. You can define your own template to control the structure and styling of the generated component.

npx @svgr/cli path/to/icon.svg --out-dir src/components --template ./template.js

TypeScript Support

This command generates TypeScript React components from SVG files. It is useful for TypeScript projects, ensuring type safety and better integration with TypeScript tooling.

npx @svgr/cli path/to/icon.svg --out-dir src/components --typescript

Other packages similar to @svgr/cli

Keywords

FAQs

Package last updated on 24 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc