TextElement
Documentation for the TextElement schema definition in the Polotno Design JSON Schema.
TextElement
Type Information
Base Type: object
Properties
Property | Type | Description |
---|---|---|
align | "left" | "center" | "right" | "justify" | Text alignment: left, center, right, justify. |
alwaysOnTop | boolean | Whether element stays on top of others. |
animations | Array<Animation > | Animation configurations. |
backgroundColor | string | Text background color. |
backgroundCornerRadius | number | Text background corner radius as percentage of half line height. |
backgroundEnabled | boolean | Whether text background is enabled. |
backgroundOpacity | number | Text background opacity (0-1). |
backgroundPadding | number | Text background padding as percentage of half line height. |
blurEnabled | boolean | Whether blur effect is enabled. |
blurRadius | number | Blur radius in pixels. |
brightness | number | Brightness level (-1 to 1). |
brightnessEnabled | boolean | Whether brightness effect is enabled. |
contentEditable | boolean | Whether element content can be edited. |
curveEnabled | boolean | Whether text curve effect is enabled. |
curvePower | number | Text curve power (-1 to 1, 0 = straight). |
custom | unknown | Custom data attached to the element. |
draggable | boolean | Whether element can be dragged. |
fill | string | Text color. |
filters | object | Applied image filters. |
fontFamily | string | Font family name. |
fontSize | number | Font size in pixels. |
fontStyle | string | Font style: 'normal' or 'italic'. |
fontWeight | string | Font weight: 'normal', 'bold', or numeric string. |
grayscaleEnabled | boolean | Whether grayscale effect is enabled. |
height | number | Height in pixels (auto-calculated at runtime). |
id | string | Unique identifier for the element. |
letterSpacing | number | Letter spacing as percentage of font size. |
lineHeight | number | string | Line height as number or string. |
name | string | Display name for the element. |
opacity | number | Opacity level (0-1). |
placeholder | string | Placeholder text when content is empty. |
resizable | boolean | Whether element can be resized. |
rotation | number | Rotation angle in degrees. |
selectable | boolean | Whether element can be selected. |
sepiaEnabled | boolean | Whether sepia effect is enabled. |
shadowBlur | number | Shadow blur radius in pixels. |
shadowColor | string | Shadow color. |
shadowEnabled | boolean | Whether shadow is enabled. |
shadowOffsetX | number | Shadow horizontal offset in pixels. |
shadowOffsetY | number | Shadow vertical offset in pixels. |
shadowOpacity | number | Shadow opacity (0-1). |
showInExport | boolean | Whether element appears in exports. |
stroke | string | Stroke color. |
strokeWidth | number | Stroke width in pixels. |
styleEditable | boolean | Whether element style can be edited. |
text | string | Visible label text shown on canvas. |
textDecoration | string | Text decoration: underline, overline, line-through, etc. |
textTransform | string | Text transform: uppercase, lowercase, capitalize, none. |
type | "text" | Element type identifier. |
verticalAlign | string | Vertical alignment: top, middle, bottom. |
visible | boolean | Whether element is visible. |
width | number | Width in pixels. |
x | number | X position in pixels. |
y | number | Y position in pixels. |
JSON Schema
{
"additionalProperties": false,
"properties": {
"align": {
"description": "Text alignment: left, center, right, justify.",
"enum": [
"left",
"center",
"right",
"justify"
],
"type": "string"
},
"alwaysOnTop": {
"description": "Whether element stays on top of others.",
"type": "boolean"
},
"animations": {
"description": "Animation configurations.",
"items": {
"$ref": "#/definitions/Animation"
},
"type": "array"
},
"backgroundColor": {
"description": "Text background color.",
"type": "string"
},
"backgroundCornerRadius": {
"description": "Text background corner radius as percentage of half line height.",
"type": "number"
},
"backgroundEnabled": {
"description": "Whether text background is enabled.",
"type": "boolean"
},
"backgroundOpacity": {
"description": "Text background opacity (0-1).",
"type": "number"
},
"backgroundPadding": {
"description": "Text background padding as percentage of half line height.",
"type": "number"
},
"blurEnabled": {
"description": "Whether blur effect is enabled.",
"type": "boolean"
},
"blurRadius": {
"description": "Blur radius in pixels.",
"type": "number"
},
"brightness": {
"description": "Brightness level (-1 to 1).",
"type": "number"
},
"brightnessEnabled": {
"description": "Whether brightness effect is enabled.",
"type": "boolean"
},
"contentEditable": {
"description": "Whether element content can be edited.",
"type": "boolean"
},
"curveEnabled": {
"description": "Whether text curve effect is enabled.",
"type": "boolean"
},
"curvePower": {
"description": "Text curve power (-1 to 1, 0 = straight).",
"type": "number"
},
"custom": {
"description": "Custom data attached to the element."
},
"draggable": {
"description": "Whether element can be dragged.",
"type": "boolean"
},
"fill": {
"description": "Text color.",
"type": "string"
},
"filters": {
"additionalProperties": {
"additionalProperties": false,
"properties": {
"intensity": {
"description": "Filter intensity value (-1 to 1).",
"type": "number"
}
},
"required": [
"intensity"
],
"type": "object"
},
"description": "Applied image filters.",
"type": "object"
},
"fontFamily": {
"description": "Font family name.",
"type": "string"
},
"fontSize": {
"description": "Font size in pixels.",
"type": "number"
},
"fontStyle": {
"description": "Font style: 'normal' or 'italic'.",
"type": "string"
},
"fontWeight": {
"description": "Font weight: 'normal', 'bold', or numeric string.",
"type": "string"
},
"grayscaleEnabled": {
"description": "Whether grayscale effect is enabled.",
"type": "boolean"
},
"height": {
"description": "Height in pixels (auto-calculated at runtime).",
"type": "number"
},
"id": {
"description": "Unique identifier for the element.",
"type": "string"
},
"letterSpacing": {
"description": "Letter spacing as percentage of font size.",
"type": "number"
},
"lineHeight": {
"description": "Line height as number or string.",
"type": [
"number",
"string"
]
},
"name": {
"description": "Display name for the element.",
"type": "string"
},
"opacity": {
"description": "Opacity level (0-1).",
"type": "number"
},
"placeholder": {
"description": "Placeholder text when content is empty.",
"type": "string"
},
"resizable": {
"description": "Whether element can be resized.",
"type": "boolean"
},
"rotation": {
"description": "Rotation angle in degrees.",
"type": "number"
},
"selectable": {
"description": "Whether element can be selected.",
"type": "boolean"
},
"sepiaEnabled": {
"description": "Whether sepia effect is enabled.",
"type": "boolean"
},
"shadowBlur": {
"description": "Shadow blur radius in pixels.",
"type": "number"
},
"shadowColor": {
"description": "Shadow color.",
"type": "string"
},
"shadowEnabled": {
"description": "Whether shadow is enabled.",
"type": "boolean"
},
"shadowOffsetX": {
"description": "Shadow horizontal offset in pixels.",
"type": "number"
},
"shadowOffsetY": {
"description": "Shadow vertical offset in pixels.",
"type": "number"
},
"shadowOpacity": {
"description": "Shadow opacity (0-1).",
"type": "number"
},
"showInExport": {
"description": "Whether element appears in exports.",
"type": "boolean"
},
"stroke": {
"description": "Stroke color.",
"type": "string"
},
"strokeWidth": {
"description": "Stroke width in pixels.",
"type": "number"
},
"styleEditable": {
"description": "Whether element style can be edited.",
"type": "boolean"
},
"text": {
"description": "Visible label text shown on canvas.",
"type": "string"
},
"textDecoration": {
"description": "Text decoration: underline, overline, line-through, etc.",
"type": "string"
},
"textTransform": {
"description": "Text transform: uppercase, lowercase, capitalize, none.",
"type": "string"
},
"type": {
"const": "text",
"description": "Element type identifier.",
"type": "string"
},
"verticalAlign": {
"description": "Vertical alignment: top, middle, bottom.",
"type": "string"
},
"visible": {
"description": "Whether element is visible.",
"type": "boolean"
},
"width": {
"description": "Width in pixels.",
"type": "number"
},
"x": {
"description": "X position in pixels.",
"type": "number"
},
"y": {
"description": "Y position in pixels.",
"type": "number"
}
},
"required": [
"align",
"alwaysOnTop",
"animations",
"backgroundColor",
"backgroundCornerRadius",
"backgroundEnabled",
"backgroundOpacity",
"backgroundPadding",
"blurEnabled",
"blurRadius",
"brightness",
"brightnessEnabled",
"contentEditable",
"curveEnabled",
"curvePower",
"draggable",
"fill",
"filters",
"fontFamily",
"fontSize",
"fontStyle",
"fontWeight",
"grayscaleEnabled",
"height",
"id",
"letterSpacing",
"lineHeight",
"opacity",
"placeholder",
"resizable",
"rotation",
"selectable",
"sepiaEnabled",
"shadowBlur",
"shadowColor",
"shadowEnabled",
"shadowOffsetX",
"shadowOffsetY",
"shadowOpacity",
"showInExport",
"stroke",
"strokeWidth",
"styleEditable",
"text",
"textDecoration",
"textTransform",
"type",
"verticalAlign",
"visible",
"width",
"x",
"y"
],
"type": "object"
}