New in Sketch 2026.1

agents.txt

You may now point your AI agents to the following URLs serving up-to-date SketchAPI documentation as plain text:

  • llms.txt – a lightweight index page with links to individual documentation sections
  • llms-full.txt – the entire SketchAPI documentation on a single page
  • /plugins/updates/llms.txt – the list of recent changes and additions to SketchAPI; useful if you want to simply refresh your agent’s existing SketchAPI skills

Independent borders

You can now override thickness for each individual side of a border for rectangles, Frames, and Graphics:

const border = layer.style.borders[0]
border.thickness = 10
border.sides.left = 5

console.log(border.sides)
// {
//   left: 5,
//   top: 10,
//   right: 10,
//   bottom: 10
// }

border.sides = {
  left: 25,
  right: 30,
}
console.log(border.sides)
// {
//   left: 25,
//   top: 10,
//   right: 30,
//   bottom: 10
// }

To check whether the given border has per-side thickness set, use Border.hasIndividualSides property:

if (border.hasIndividualSides) {
  console.log(`This border mixed thickness`)
}

To reset the given border to a uniform thickness, assign null to its sides property:

border.sides = null

// Note: `Border.thickness` will be set to the max individual side thickness
console.log(border.thickness)
// 30
console.log(border.hasIndividualSides)
// false

Stacks

Applying a StackLayout to a Group now triggers an immediate layout update, ensuring the Group has up-to-date geometry from the start:

const group = new Group.Frame({
  layers: [
    new Shape({
      frame: new Rectangle(0, 0, 100, 100),
    }),
  ],
  stackLayout: {
    padding: 10,
  },
})

console.log(group.frame)
// => (0, 0, 120, 120) -- paddings included ✅

The layout update occurs automatically each time a StackLayout is modified:

group.stackLayout.padding = 0

console.log(group.frame)
// => (0, 0, 100, 100) -- zero paddings ✅

Added StackLayout.apply()

In some cases – such as after making changes to individual stack items – you may still need to trigger a manual stack layout update. Use the new StackLayout.apply() method for that:

// Resizing a stack item directly
group.layers[0].frame.width = 1000

console.log(group.frame)
// => (0, 0, 120, 120) -- the new item width isn't accounted for ❌

group.stackLayout.apply()

console.log(group.frame)
// => (0, 0, 1020, 120) -- the stack geometry is now up to date ✅

Also in Stacks

  • Fixed an issue where assigning a StackLayout to a Group didn’t reset its cross-axis sizing to Fit, preventing the stack from sizing itself correctly in that direction.
  • Fixed an issue where assigning a new padding-less StackLayout to a Group (as well as removing the existing StackLayout entirely) failed to remove the stack’s existing padding.

DataSupplier

Sketch can now import image files from the Contents/Resources folder inside a plugin bundle when those image files are referenced via a relative path in the structured data provided via the DataSupplier API:

function onProvideData(dataContext) {
  // Assuming the following plugin bundle structure:
  //  .
  //  └── Contents
  //      ├── Resources
  //      │   └── images
  //      │       ├── one.png
  //      │       ├── three.png
  //      │       └── two.png
  //      └── Sketch
  //          ├── DataProvider.js
  //          └── manifest.json
  DataSupplier.supplyData(dataContext.data.key, {
    'Card 1': {
      title: 'One',
      image: 'images/one.png',
    },
    'Card 2': {
      title: 'Two',
      image: 'images/two.png',
    },
    'Card 3': {
      title: 'Three',
      image: 'images/three.png',
    },
  })
}

Other Changes and Bugfixes

  • Added Document.zoomToFitCanvas(), which adjusts the zoom level and scroll position as needed to fit all layers of the current page in the canvas viewport.
  • Added the Style.Corners.smoothing property for fine-grained control over corner smoothing:

    const { Style } = require('sketch')
    
    layer.style.corners.style = Style.CornerStyle.Smooth
    layer.style.corners.smoothing = 0.6
    
  • Added the Layer.nameIsFixed property to prevent Sketch from auto-updating a layer’s name, which often affects text layers.
  • Added Group.clipsContents for supported containers: Frames, Graphics, and Symbol Masters.
  • Added support for direct Array-like access and enumeration for Document.selectedLayers and Page.selectedLayers objects:

    const layer = document.selectedLayers[0]
    const layer = page.selectedLayers[6]
    
    for (const layer of document.selectedLayers) {
      console.log(`${layer.name}`)
    }
    
  • Fixed Group.isFrame and Group.isGraphicFrame for Groups that don’t have an explicit Frame or Graphic group behavior, but still act like one.
  • Deprecated Group.groupBehavior:getter in favor of Group.isFrame and Group.isGraphicFrame.
  • Changing Layer.name now automatically sets its nameIsFixed to true.
  • ImageData.base64 is no longer included in console.log() and Layer.toJSON() output when printing image layers.
  • Removed the legacy Objective-C APIs for installing accessory header/footer views in the Sketch sidebar:
    • -[MSMainSplitViewController insertAccessoryViewAtopCanvas:constrainingHeight:]
    • -[MSMainSplitViewController insertAccessoryViewBeneathCanvas:constrainingHeight:]
    • -[MSMainSplitViewController removeAccessoryViewAtopCanvas:]
    • -[MSMainSplitViewController removeAccessoryViewBeneathCanvas:]

    If your plugin uses these APIs to extend Sketch UI, please reach out via the Community Forum or email developer@sketch.com, so we can suggest the right replacement for your use case.

  • Made changes to the following deprecated Objective-C APIs:
Removed Replacement
-[MSExporter exporterForRequest:colorSpace:driver:] -[MSExporter exporterForRequest:colorSpace:options:]
-[MSExporer data] -[MSExporter dataAndReturnError:]
-[MSLayer duplicate] Layer.duplicate()
-[MSLayer select:byExpandingSelection:] Layer.selected
-[MSSymbolInstance overrides] SymbolInstance.overrides
-[MSDocumentData allLayerStyles] Document.sharedLayerStyles
-[MSDocumentData allTextStyles] Document.sharedTextStyles
  • Removed old and new keys from the TextChanged action context.