TLInstancePresence
See source codeTable 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 | nullcamera
camera: {
x: number
y: number
z: number
} | nullchatMessage
chatMessage: stringcolor
color: stringcurrentPageId
currentPageId: TLPageIdcursor
cursor: {
rotation: number
type: TLCursor['type']
x: number
y: number
} | nullfollowingUserId
followingUserId: null | stringid
readonly
from BaseRecord
readonly id: IdlastActivityTimestamp
lastActivityTimestamp: null | numbermeta
meta: JsonObjectscreenBounds
screenBounds: BoxModel | nullscribbles
scribbles: TLScribble[]selectedShapeIds
selectedShapeIds: TLShapeId[]typeName
readonly
from BaseRecord
readonly typeName: TypeNameuserId
userId: stringuserName
userName: stringPrev
TLInstancePageStateNext
TLLineShapePoint