mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-08-15 12:55:43 +02:00
svgr: add page (#7882)
This commit is contained in:
parent
24aa00d414
commit
c85155ec0b
1 changed files with 32 additions and 0 deletions
32
pages/common/svgr.md
Normal file
32
pages/common/svgr.md
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
# svgr
|
||||||
|
|
||||||
|
> Transform SVGs into React components.
|
||||||
|
> More information: <https://react-svgr.com>.
|
||||||
|
|
||||||
|
- Transform a SVG file into a React component to stdout:
|
||||||
|
|
||||||
|
`svgr -- {{path/to/file.svg}}`
|
||||||
|
|
||||||
|
- Transform a SVG file into a React component using TypeScript to stdout:
|
||||||
|
|
||||||
|
`svgr --typescript -- {{path/to/file.svg}}`
|
||||||
|
|
||||||
|
- Transform a SVG file into a React component using JSX transform to stdout:
|
||||||
|
|
||||||
|
`svgr --jsx-runtime automatic -- {{path/to/file.svg}}`
|
||||||
|
|
||||||
|
- Transform all SVG files from a directory to React components into a specific directory:
|
||||||
|
|
||||||
|
`svgr --out-dir {{path/to/output_directory}} {{path/to/input_directory}}`
|
||||||
|
|
||||||
|
- 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_directory}}`
|
||||||
|
|
||||||
|
- 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|kebab|pascal}} {{path/to/input_directory}}`
|
||||||
|
|
||||||
|
- 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_directory}}`
|
Loading…
Add table
Reference in a new issue