Updates the content of one or more selected elements.
To learn more, see Transforming elements.
Usage
import { selection } from "@canva/preview/design";(async () => {await selection.setContent("<SELECTION_EVENT>", async (state) => {return state;});})();
Rate limit
This method has a rate limit of 20 requests every 10 seconds.
Parameters
Required
A selection event.
Required
A function that transforms the element(s) in a selection event.
Returns
Promise<void>