How to save additional metadata into a design?
In some use cases, you may want to save your own data into the store/page/element. You may want to save:
Name of the design
Design
id
Custom page properties
Element metadata
For such use cases, you can use custom
attribute. It is available for all nodes in the store: the store itself, any page, any element.
custom
must be an object {}
. You can write any data into that object. Polotno never uses it for rendering, so it is under your control. By default, custom
will be null
, this is why when you read some data in custom
, make sure it is defined.