const canva = window.canva.init();
textInputExample: "Hello world",
canva.onControlsEvent(async (opts) => {
if (!opts.message.commit) {
if (opts.message.controlType === "text_input") {
state[opts.message.controlId] = opts.message.message.value;
function renderControls() {
canva.create("text_input", {
placeholder: "Enter some text...",
label: "Text Input Example",
value: state.textInputExample,
canva.create("text_input", {
id: "numberInputExample",
placeholder: "Enter a number...",
label: "Number Input Example",
value: state.numberInputExample,
canva.updateControlPanel(controls);