">
NRStudio
SVG Code to File · SVG Viewer · SVG to IMG · React Native SVG

SVG Code to File Converter

Paste any SVG image code, preview it live, download as a SVG file, convert to PNG, or get the Base64. Also learn to import SVG react and use React Native SVG.

SVG Code (svg coding)

Characters: 0 | View SVG code structure

Live Preview — Render SVG

BG:
Your SVG will appear here

Import SVG React — React SVG Icon

How to import SVG react as a component or use a react svg icon:

// Method 1: As <img> (svg to img) import logo from './logo.svg'; <img src={logo} alt="icon" /> // Method 2: Inline SVG element import { ReactComponent as Logo } from './logo.svg'; <Logo className="w-6 h-6" /> // Method 3: SVGR (import svg react — recommended) // vite.config.js: add vite-plugin-svgr import Logo from './logo.svg?react';

React Native SVG — SVGs in React Native

How to use svgs in react native with react-native-svg:

// Install react-native-svg npm install react-native-svg // render svg in React Native import Svg, { Circle, Rect, Path } from 'react-native-svg'; function MyIcon() { return ( <Svg width="24" height="24" viewBox="0 0 24 24"> <Circle cx="12" cy="12" r="10" fill="teal" /> </Svg> ); } // SVG converter for cricut: export as SVG file above

SVG Format Reference — SVG Element & SVG File Structure

A quick SVG format cheatsheet covering common SVG element types and SVG coding patterns.

<svg>

Root SVG element. width, height, viewBox attributes required.

<circle>

cx, cy, r — center and radius. Fill with fill="" attribute.

<rect>

x, y, width, height, rx (rounded corners).

<path>

d attribute with M (move), L (line), C (curve), Z (close).

<text>

x, y, font-size, fill. Can use <tspan> for multiline.

<line>

x1, y1, x2, y2 — draws a straight line.

<polygon>

points="x1,y1 x2,y2 …" — closed shape.

<g>

Group element. Apply transforms to all children.