Paragraph
API reference for the "Paragraph" control.
Renders a paragraph within the Canva UI.
To learn how controls work, refer to Rich controls.

Usage

1
canva.create("paragraph", {
2
id: "paragraphExample",
3
text: "This is a paragraph.",
4
});
Copied!

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 character in this property.

Event

This control does not emit an event.

Example

1
const canva = window.canva.init();
2
3
canva.onReady(() => {
4
renderControls();
5
});
6
7
function renderControls() {
8
const controls = [
9
canva.create("paragraph", {
10
id: "paragraphExample",
11
text: "This is a paragraph.",
12
}),
13
];
14
15
canva.updateControlPanel(controls);
16
}
Copied!
Last modified 3d ago