Skip to content

Item Types Overview

Every element on the canvas is an item. All items share a set of common properties and can be created with addItem from useStudio.

Available Types

TypeDescription
ImageRaster images with filters, borders, masks, and cropping
TextText with full typography control
ShapeSVG-based vector shapes
DrawFreehand pen strokes
ShapeDrawBezier shape drawing
VideoVideo clips with trim, volume, and borders
AudioAudio tracks with trim and volume

Common Properties

All item types share these base properties:

PropertyTypeDescription
idstringUnique identifier (auto-generated on addItem).
typestringThe item type string.
xnumberX position on the canvas (pixels).
ynumberY position on the canvas (pixels).
widthnumberWidth in pixels.
heightnumberHeight in pixels.
rotationnumberRotation in degrees. Optional.
opacitynumberOpacity from 0 to 1. Optional.
lockedbooleanWhen true, the item cannot be selected or moved in the editor. Optional.
groupIdstringID of the parent group. Optional.
enterEnterAnimationAnimation played when the item enters the timeline. Optional.
exitExitAnimationAnimation played when the item exits the timeline. Optional.
effectEffectAnimationContinuous effect animation. Optional.

Creating Items

tsx
const { addItem } = useStudio();

// All items follow the same pattern:
addItem("Image", {
  x: 0,
  y: 0,
  width: 400,
  height: 300,
  itemProps: {
    // ... type-specific properties
  },
});

Updating Items

tsx
const { updateItem } = useStudio();

// Update base properties by item ID
updateItem(item.id, {
  x: 100,
  opacity: 0.8,
  rotation: 45,
});

// Update type-specific properties
updateItem(item.id, {
  itemProps: { color: "#ff0000" },
});

Released under a proprietary license.