Paragraph

API reference for the "Paragraph" control.

Renders a paragraph within the Canva UI.

To learn how controls work, refer to Rich controls.

Usage

canva.create('paragraph', {
id: 'paragraphExample',
text: 'This is a paragraph.',
});

Parameters

Name

Type

Required

Description

controlType

string

Yes

The type of control. To create a paragraph, the value must be "paragraph".

opts

object

Yes

Properties for configuring the control.

opts.id

string

Yes

A unique ID for the control.

opts.text

string

Yes

The text that appears in the paragraph. You can't use the \n character in this property.

Event

This control does not emit an event.

Example

const canva = window.canva.init();
canva.onReady(() => {
renderControls();
});
function renderControls() {
const controls = [
canva.create('paragraph', {
id: 'paragraphExample',
text: 'This is a paragraph.',
}),
];
canva.updateControlPanel(controls);
}