TLInstancePresence

See source code
Table of contents

Extends BaseRecord<'instance_presence', TLInstancePresenceID>.

Represents the presence state of a user in a collaborative tldraw session. This record tracks what another user is doing: their cursor position, selected shapes, current page, and other real-time activity indicators.

Instance presence records are used in multiplayer environments to show where other collaborators are working and what they're doing.

interface TLInstancePresence extends BaseRecord<
  "instance_presence",
  TLInstancePresenceID
> {}

Example

const presence: TLInstancePresence = {
  id: "instance_presence:user123",
  typeName: "instance_presence",
  userId: "user123",
  userName: "Alice",
  color: "#FF6B6B",
  cursor: { x: 100, y: 150, type: "default", rotation: 0 },
  currentPageId: "page:main",
  selectedShapeIds: ["shape:rect1"],
};

Properties

brush

brush: BoxModel | null;

camera

camera: {
  x: number;
  y: number;
  z: number;
} | null;

chatMessage

chatMessage: string;

color

color: string;

currentPageId

currentPageId: TLPageId;

cursor

cursor: {
  rotation: number;
  type: TLCursor["type"];
  x: number;
  y: number;
} | null;

followingUserId

followingUserId: null | string;

id

readonly
readonly id: Id;

lastActivityTimestamp

lastActivityTimestamp: null | number;

meta

meta: JsonObject;

screenBounds

screenBounds: BoxModel | null;

scribbles

scribbles: TLScribble[];

selectedShapeIds

selectedShapeIds: TLShapeId[];

typeName

readonly
readonly typeName: TypeName;

userId

userId: string;

userName

userName: string;

Prev
TLInstancePageState
Next
TLLineShapePoint