Docs

\

Examples

|

Built by nnsncl at Foundation UI. The source code is available on Github.

Examples


Try out the different combinations that @usefui/svgjsx offers.

Custom source directory

Run the generate command with the -s option:

pnpx @usefui/svgjsx generate -s ./src/assets/svg
Output directory

The output directory will be set at the root of your project. Make sure your svg icon files are defined in ./src/assets/svg before you run the generate command.

Custom output directory

Run the generate command with the -o option:

pnpx @usefui/svgjsx generate -o ./src/components/icons
Output directory

Make sure you have the /svg folder with your svg icon files in it at the root of your project before you run the generate command.

Custom source/output

Run the generate command with the -s and -o options:

pnpx @usefui/svgjsx generate -s ./src/assets/svg -o ./src/components/icons

Usage

import { Icon } from "./src/icons"; function App() { return ( <Icon fill="green" width={24} height={24} viewBox="0 0 16 16" > <Icon.MyIcon /> </Icon> ); }