Skip to main content
100%

Paste In SVG code

✓ Published0🌍 Public
KKevinGutowski
Last edited Apr 2, 2019
Created on Apr 2, 2019

This example demonstrates how to insert raw SVG markup directly into a Sketch document using the Sketch DOM API and the `sketch/createLayerFromData` function with an 'svg' format. The code prompts the user for an SVG string through `UI.getInputFromUser`, then assigns the resulting layer to the selected page. It relies on the `sketch/dom` module to handle document and page selection, and `sketch/ui` for the input dialog, creating a quick bridge between external SVG code and Sketch’s native layer hierarchy.

AI-generated description

Similar vizzes