TLAsset

See source code

Union type representing all possible asset types in tldraw. Assets represent external resources like images, videos, or bookmarks that can be referenced by shapes.

type TLAsset = TLBookmarkAsset | TLImageAsset | TLVideoAsset;

Example

const imageAsset: TLAsset = {
  id: "asset:image123",
  typeName: "asset",
  type: "image",
  props: {
    src: "https://example.com/image.jpg",
    w: 800,
    h: 600,
    mimeType: "image/jpeg",
    isAnimated: false,
  },
  meta: {},
};
Prev
TLArrowShapeKind
Next
TLAssetId