TLDefaultShape

See source code

The default set of shapes that are available in the editor.

This union type represents all the built-in shape types supported by tldraw, including arrows, bookmarks, drawings, embeds, frames, geometry shapes, groups, images, lines, notes, text, videos, and highlights.

Example

// Check if a shape is a default shape type
function isDefaultShape(shape: TLShape): shape is TLDefaultShape {
  const defaultTypes = [
    "arrow",
    "bookmark",
    "draw",
    "embed",
    "frame",
    "geo",
    "group",
    "image",
    "line",
    "note",
    "text",
    "video",
    "highlight",
  ];
  return defaultTypes.includes(shape.type);
}
Prev
TLDefaultRecord
Next
TLDefaultSizeStyle