CmdID

CmdID / Commands

svgr

Transform SVGs into React components. tldr-pages

On several platforms

Opens CmdID with your command. It is read in your browser and sent nowhere.

Several platforms

from tldr-pages, CC BY 4.0

Transform an SVG file into a React component to stdout

svgr -- path/to/file.svgIdentify

Transform an SVG file into a React component using TypeScript to stdout

svgr --typescript -- path/to/file.svgIdentify

Transform an SVG file into a React component using JSX transform to stdout

svgr --jsx-runtime automatic -- path/to/file.svgIdentify

Transform all SVG files from a directory to React components into a specific directory

svgr --out-dir path/to/output_directory path/to/input_directoryIdentify

Transform all SVG files from a directory to React components into a specific directory skipping already transformed files

svgr --out-dir path/to/output_directory --ignore-existing path/to/input_directoryIdentify

Transform all SVG files from a directory to React components into a specific directory using a specific case for filenames

svgr --out-dir path/to/output_directory --filename-case camel path/to/input_directoryIdentify

Transform all SVG files from a directory to React components into a specific directory without generating an index file

svgr --out-dir path/to/output_directory --no-index path/to/input_directoryIdentify