Import an SVG as Rive vector shapes
riv_import_svgConvert SVG files (Figma/Illustrator exports) into Rive bezier path shapes. Produces a scene-fragment JSON with gradients and strokes, enabling high-quality artwork for animations.
Instructions
Convert an SVG file (Figma/Illustrator export, icon, illustration) into Rive bezier path shapes — the professional way to get high-quality artwork instead of drawing with primitives. Writes a scene-fragment JSON (shapes with full cubic vertices, gradients, strokes) and returns a rendered preview. Use the fragment in riv_create via "imports". Supports path/rect/circle/ellipse/polygon/polyline/line, nested transforms, style attrs, linear/radial gradients. Not imported: (use texts[] with a font), , filters, masks.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"outSpec": "<outSpec>"
},
"name": "riv_import_svg"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| svg | No | Inline SVG markup (alternative to svgPath) | |
| outSpec | Yes | Output scene-fragment JSON path (e.g. logo.scene.json) | |
| svgPath | No | Path to the .svg file | |
| idPrefix | No | Prefix for generated shape ids (avoid collisions) |