XD 19 Plugin APIs: Interactions, Polygon, and More
If you’ve been following our updates, you’ve probably heard about the exciting updates to XD Plugin APIs coming this summer. As the Adobe XD Plugin APIs continue to evolve, we are going to bring some HTML/CSS rendering changes, and we’ll be introducing panels as an additional UI entry point
As you may have read yesterday, XD 19 is a massive update to Adobe XD, and we’re excited to share that many of the features are extensible via the Plugin APIs. In this article, I’ll talk about the new APIs available in XD 19, including:
- Interactions API
- Polygon API
- Text Manipulation API
These new APIs are available in the latest XD 19 update. To get started, take a look at the XD Plugin API documentation. If you’d like to be able to try upcoming beta APIs in advance of a public release, you can join the XD plugin developer prerelease program. To join, email us to request access at firstname.lastname@example.org.
Interactions API (a.k.a. Prototyping)
We have received numerous feature requests on the XD Developer Forum for exposing APIs to extend the Prototype section of XD. We are happy to announce that XD 19 includes the READ version of the Interactions API, which allows developers to get data about the current state of the interactions in the prototype tab in XD, such as trigger node, trigger type, transition, and others.
Take a look at this sample:
The output interaction JSON will look like this:
As you can see, this new Interactions API provides you with a comprehensive data set of the existing prototype interactions. With this data, you can surface information about prototype interactions or even regenerate the rendering experience of the prototypes on your platform. Refer to Adobe XD Plugin Reference to learn more about this new API.
We’ll also expose the WRITE version of this API in the future as well — stay tuned!
XD 19 has a new drawing tool called “Polygon”, which lets you create a polygon shape with up to 100 sides.
Above is a hexagon with round edges created with the Polygon tool. You will also be able to access this feature through the Plugin APIs. For example, if you wanted to create the same hexagon programmatically, you would be able to do that with less than 10 lines of code:
Check the documentation on this API on our docs site. We’ve also created a sample for you to play around with:
This example can be found in the Adobe XD Samples repository.
Text manipulation API
XD 19 adds some new text manipulation features, such as strikethrough, lower case, upper case, and title case. All these new text formats can be set with the APIs.
You can check out the documentation on this API on our docs site.
These new APIs are already available in the latest version of XD, so make sure to update XD to the latest version. Here are some useful links for exploring these new APIs:
If you want to gain early access to the beta APIs, you can join the XD plugin prerelease by emailing us at email@example.com. Once approved, you’ll need to sign an NDA, upon which you’ll get access. Prerelease members get early builds with API changes, as well as a private community forum for discussions and code-level help from Adobe staff and other community developers.