All Projects → darknoon → sketchapp-json-plugin

darknoon / sketchapp-json-plugin

Licence: MIT license
Provides utilities for basing your plugins on the JSON format instead of learning all of the sketch private API objects.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to sketchapp-json-plugin

Persiansupplier
Sketch Plugin for supplying dynamic persian data.
Stars: ✭ 46 (-14.81%)
Mutual labels:  sketch-plugin, sketchapp
Sketch Dynamic Button 3.5
Up-to-date version of the original Dynamic button for Sketch.app.
Stars: ✭ 237 (+338.89%)
Mutual labels:  sketch-plugin, sketchapp
Svgo Compressor
A Plugin that compresses SVG assets using SVGO, right when you export them.
Stars: ✭ 1,068 (+1877.78%)
Mutual labels:  sketch-plugin, sketchapp
Sketchcrapp
SketchCrapp - Crack your Sketch.app in seconds :) Supports MacOS Big Sur.
Stars: ✭ 218 (+303.7%)
Mutual labels:  sketch-plugin, sketchapp
Overrideit Sketchplugin
Overrideit is sketch plugin that allow designers to search in overridelist and overrides dropdowns, and with many other features.
Stars: ✭ 113 (+109.26%)
Mutual labels:  sketch-plugin, sketchapp
Sketch Map Generator
Sketch plugin to fill a shape with a map generated from a given location using Google Maps and Mapbox
Stars: ✭ 824 (+1425.93%)
Mutual labels:  sketch-plugin, sketchapp
Camilo
Sketch plugin specially crafted to work in Design systems with multiple themes
Stars: ✭ 175 (+224.07%)
Mutual labels:  sketch-plugin, sketchapp
Sort Me Sketch
Sort artboards and layers by name
Stars: ✭ 547 (+912.96%)
Mutual labels:  sketch-plugin, sketchapp
Sketch Css Sprite Mixin
Generate a code of CSS Sprite Mixin to Clipboard in Sketch.
Stars: ✭ 105 (+94.44%)
Mutual labels:  sketch-plugin, sketchapp
Ishadow
Creating a beautiful iOS style shadow [Sketch Plugin]
Stars: ✭ 89 (+64.81%)
Mutual labels:  sketch-plugin, sketchapp
Sketch Find And Replace
Sketch plugin to do a find and replace on text within layers
Stars: ✭ 693 (+1183.33%)
Mutual labels:  sketch-plugin, sketchapp
sketch-bootstrap-helpers
Helpers plugin to work with bootstrap grid in Sketch
Stars: ✭ 16 (-70.37%)
Mutual labels:  sketch-plugin, sketchapp
Artboard Manager
Because moving Artboards manually is *so* 2016
Stars: ✭ 672 (+1144.44%)
Mutual labels:  sketch-plugin, sketchapp
Sketch Commands
A collection of script commands for Sketch.app
Stars: ✭ 826 (+1429.63%)
Mutual labels:  sketch-plugin, sketchapp
Html Sketchapp Cli
Quickly generate Sketch libraries from HTML documents and living style guides, powered by html-sketchapp
Stars: ✭ 631 (+1068.52%)
Mutual labels:  sketch-plugin, sketchapp
Chart
Create the most popular types of charts by real or random data
Stars: ✭ 1,101 (+1938.89%)
Mutual labels:  sketch-plugin, sketchapp
Sync.sketchplugin
Keep your design team in sync!
Stars: ✭ 357 (+561.11%)
Mutual labels:  sketch-plugin, sketchapp
Compo Sketch
Makes it easier to work with interface components in Sketch
Stars: ✭ 486 (+800%)
Mutual labels:  sketch-plugin, sketchapp
Notes
A sketch plugin for taking notes
Stars: ✭ 87 (+61.11%)
Mutual labels:  sketch-plugin, sketchapp
Sketch Batch Create Symbols
A plugin for Sketch to convert selected layers to individual symbols.
Stars: ✭ 134 (+148.15%)
Mutual labels:  sketch-plugin, sketchapp

Sketch.app JSON Plugin library

Provides utilities for basing your plugins on the JSON format instead of learning all of the sketch private API objects.

This is indended to be used within the Sketch plugin environment; to generate sketch files entirely in node.js, you need a different library.

There are 2 main APIs:

// Converts an object, eg from context.selection into a JSON string representation
toSJSON(sketchObject);

// Takes a Sketch JSON tree and turns it into a native object. May throw on invalid data
fromSJSON(json);

Additionally, if you would like to create layers from a dictionary, you want this:

// Pass in a javascript object literal
const obj: SJTextLayer = {
"_class": "text",
"do_objectID": generateID(),
"frame": {
  "_class": "rect",
  "constrainProportions": false,
  "height": 17,
  "width": 117,
  "x": 146,
  "y": 253
},
"isVisible": true,
"name": "My hot hot ABCD",
...

};
fromSJSONObject(obj);

If you want to verify your version of Sketch is compatible (v43+):

import JSONPlugin from 'sketchapp-json-plugin';
if (JSONPlugin.appVersionSupported()) {
  const layer = SJSON.fromSJSON(myJSON);
  ...
  document.pages[0].addLayers([layer]);
} else {
  // Use old code path
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].