React SVG Viewer is a powerful Visual Studio Code extension that allows you to instantly display and preview React SVG components directly within your editor.
🚀 Features
🛠️ Supports React DOM and React Native: Works with both React DOM and React Native projects, enabling SVG preview across platforms.
🔧 JSX and TSX Support: Full support for both .jsx and .tsx files, making it a perfect tool for modern React development.
🌐 Global Props Support: Define global props for your SVG components via the configuration for customization across projects.
💡 Usage
Show React SVG Components (Current File)
Open a React file containing SVG components (either JSX or TSX).
Run the command React SVG Viewer: Show React SVG Components (Current File) from the command palette (Cmd+Shift+P or Ctrl+Shift+P).
Instantly view the rendered SVG components in a webview panel within VSCode.
Show React SVG Components (Config Paths)
In your VSCode settings (settings.json), add the paths to the React SVG files using the react-svg-viewer.paths property:
react-svg-viewer.globalProps: A set of global props that will be applied to all SVG components in the specified files. This is useful for adding default attributes like size or color: