Text Element

PropTypeRequiredExampleValue RangeDescription
contentstringtrue--The text content displayed by the element.
textStyleobjecttrue--The base styling options for the text content, including font, color, shadow, and stroke settings. This serves as the default style for all text.
rangesarrayfalse--Rich text formatting ranges that allow different styles to be applied to specific portions of the text content. Each range defines a start position, end position, and style overrides.
bgColorstringfalse--The background color of the text element, in hex format.
bgAlphanumberfalse-0 - 1The transparency level of the text background. 1 represents full opacity, and 0 represents full transparency.
bgRadiusnumberfalse--The corner radius of the text background, in pixels.

Rich Text Ranges

Rich text ranges allow you to apply different styles to specific portions of the text content. Each range object contains:

PropTypeRequiredExampleValue RangeDescription
startnumbertrue->= 0The starting character position (inclusive) where this style should be applied.
endnumbertrue-> startThe ending character position (exclusive) where this style should end.
styleobjecttrue--The style overrides to apply to this text range. Any properties not specified will inherit from the base textStyle.

Text Style (Base Style)

The textStyle object defines the base styling that applies to all text content. When using rich text ranges, any style properties not specified in a range will inherit these base values.

PropTypeRequiredExampleValue RangeDescription
fillstringtrue--The text color, in hex format.
fontSizenumbertrue-> 0The font size of the text, in pixels.
fontFamilystringtrue-Arial, Helvetica, Times New Roman, Georgia, Verdana, Tahoma, Trebuchet MS, Impact, Comic Sans MS, Courier NewThe font family used for the text.
alignstringtrue-left, center, right, justifyThe alignment of the text content.
lineHeightnumbertrue->= 0The line height of the text content, in pixels.
letterSpacingnumbertrue--The spacing between characters in the text content, in pixels.
wordSpacingnumberfalse--The spacing between words in the text content, in pixels.
fontWeightstringfalse-normal, bold, 100, 200, 300, 400, 500, 600, 700, 800, 900The weight (thickness) of the font.
fontStylestringfalse-normal, italic, obliqueThe style of the font.
textShadowstringfalse--CSS text-shadow property value for additional shadow effects.
underlinebooleanfalse--Indicates whether the text content has underline decoration.
strikethroughbooleanfalse--Indicates whether the text content has strikethrough decoration.
isBoldbooleantrue--Indicates whether the text content is displayed in bold.
isItalicbooleantrue--Indicates whether the text content is displayed in italics.
shadowEnabledbooleantrue--Indicates whether a shadow-sm effect is applied to the text content.
shadowColorstringtrue--The color of the shadow-sm effect, in hex format.
shadowBlurnumbertrue->= 0The blur-sm radius of the shadow-sm effect, in pixels.
shadowAlphanumbertrue-0 - 1The transparency level of the shadow-sm effect. 1 represents full opacity, and 0 represents full transparency.
shadowAnglenumbertrue->= 0The angle of the shadow-sm effect, in radians.
shadowDistancenumbertrue->= 0The distance between the text content and the shadow-sm effect, in pixels.
strokestringtrue--The color of the stroke effect, in hex format.
strokeWidthnumbertrue->= 0The width of the stroke effect, in pixels.
textElement.json
1{ 2 "id": "556e5b07-9f6d-49fa-804a-a1ac523cdd82", 3 "type": "Text", 4 "start": 0, 5 "duration": 5, 6 "trackIndex": 0, 7 "x": 166.1738354439909, 8 "y": -59.92190375317854, 9 "blendMode": "normal", 10 "anchorX": 0, 11 "anchorY": 0, 12 "rotation": 0, 13 "scaleX": 2.8948529361581095, 14 "scaleY": 2.8948529361581095, 15 "alpha": 1, 16 "skewX": 0, 17 "skewY": 0, 18 "keyframes": [], 19 "content": "Add Heading", 20 "textStyle": { 21 "fill": "#FFFFFF", 22 "fontSize": 36, 23 "fontFamily": "Arial", 24 "align": "center", 25 "lineHeight": 0, 26 "letterSpacing": 0, 27 "isBold": true, 28 "isItalic": false, 29 "shadowEnabled": true, 30 "shadowColor": "#000000", 31 "shadowBlur": 4, 32 "shadowAlpha": 1, 33 "shadowAngle": 0.5235987755982988, 34 "shadowDistance": 6, 35 "stroke": "#000000", 36 "strokeWidth": 3 37 }, 38 "bgColor": "#f2c9ff", 39 "bgAlpha": 0, 40 "bgRadius": 10 41} 42