TLTextShape

See source code

A text shape that can display formatted text content with various styling options. Text shapes support rich formatting, automatic sizing, and consistent styling through the tldraw style system.

type TLTextShape = TLBaseShape<"text", TLTextShapeProps>;

Example

const textShape: TLTextShape = {
  id: "shape:text123",
  typeName: "shape",
  type: "text",
  x: 100,
  y: 200,
  rotation: 0,
  index: "a1",
  parentId: "page:main",
  isLocked: false,
  opacity: 1,
  props: {
    color: "black",
    size: "m",
    font: "draw",
    textAlign: "start",
    w: 200,
    richText: toRichText("Sample text"),
    scale: 1,
    autoSize: false,
  },
  meta: {},
};
Prev
TLStoreSnapshot
Next
TLUnknownBinding