Properties
Property | Type | Default | Description |
---|---|---|---|
id | string | uuid() | A unique identifier for the element. |
name | string | - | A name for the element. |
type | string | 9:16 | The type of element (e.g., text , image , video , shape , etc.) |
x | number | 0 | The x position of the element |
y | number | 0 | The y position of the element |
width | number | - | The width of the element |
height | number | - | The height of the element |
rotation | number | 0 | The rotation angle of the element in degrees |
scale | number | 1 | The scale factor of the element |
opacity | number | 1 | The opacity of the element (0 to 1) |
animations | array | [] | An array of Animation objects applied to the element. |
keepRatio | boolean | false | Keep the ratio while resizing the element. |
originCenter | boolean | false | If true , use the center of the element as self origin |
anchorToCenter | boolean | false | If true , use the center of the stage as world origin |
Usage
Here’s an example of how to create and customize different types of elements:Element Types
BlendDuck supports various types of elements. Below are the descriptions of each element type along with example code snippets to create them.Text
TheText
element allows you to add customizable text content to your videon. You can modify properties such as font size, style, and alignment.
Property | Type | Default | Description |
---|---|---|---|
text | string | - | The content of the text. |
textAlign | enum | center | The alignment of the text (e.g., left , right ). |
fontSize | number | 60 | The size of the font in pixels. |
fontFamily | string | null | The font family of the text, if null , using the fontFamily in Theme. |
bold | bool | false | If true, the text is bold. |
italic | bool | false | If true, the text is italic. |
underline | bool | false | If true, the text has an underline. |
strikethrough | bool | false | If true, the text has a strikethrough. |
textStyle | enum | none | The style of the text (e.g., shadow , neon , stack , stage , glitch ). |
autoSize | bool | true | If true, the text box adjusts its size automatically. |
Image
TheImage
element enables you to add static images from a URL.
Property | Type | Default | Description |
---|---|---|---|
url | string | - | The URL of the image. |
radius | number | 0 | The border radius of the image. |
Video
TheVideo
element allows you to embed video content from a URL. You can manage playback properties such as volume and looping.
Property | Type | Default | Description |
---|---|---|---|
url | string | - | The URL of the video. |
volume | boolean | 1 | The volume of the video (0-1). |
loop | boolean | false | If true, the video will loop. |
radius | number | 0 | The border radius of the video. |
Emoji
TheEmoji
element lets you add dynamic emojis to your Clip
.
Property | Type | Default | Description |
---|---|---|---|
url | string | - | the URL of the emoji |
Shape
TheShape
element allows you to add basic geometric shapes to your Clip
. You can customize their appearance with different colors or gradients, making them useful for creating backgrounds, dividers, or other visual elements.
Property | Type | Default | Description |
---|---|---|---|
shapeId | string | - | The shape ID of the shape element. |
fill | color | - | The color or gradient of the shape. |
Lottie
TheLottie
element allows you to embed lightweight animations by Lottie URL, the URL can be .json
or .lottie
.
Property | Type | Default | Description |
---|---|---|---|
url | string | - | the URL of the lottie file |
Group
TheGroup
element acts as a container for other elements. By grouping multiple elements together, you can apply transformationsto the group as a whole, allowing for better organization and control over complex layouts.
Property | Type | Default | Description |
---|---|---|---|
children | array | [] | The array of elements that form the group. |
Widget
TheWidget
element allows for embedding custom-built components. This flexible element type is ideal for dynamic data visualizations, charts, or other resuable blocks in your video.
Property | Type | Default | Description |
---|---|---|---|
scope | string | - | The widget package scope identifier. |
widgetId | string | - | The widget ID in the scope. |
play | object | - | The widget AudioPlay |
Widget
is an extension of an Element
. You can use the built-in ready-made widgets or develop your own widgets.
Builtin Widgets
Use ready-made widgets out of box
Build a Widget
Make a widget customized for your needs.