TLCursor
See source codeTable of contents
A cursor object used throughout the tldraw editor.
Represents both the cursor type (which determines the visual appearance) and its rotation angle. The rotation is particularly useful for resize and rotation cursors that need to align with the current interaction angle.
interface TLCursor {}
Example
// Default cursor
const defaultCursor: TLCursor = {
type: 'default',
rotation: 0,
}
// Rotated resize cursor
const rotatedResizeCursor: TLCursor = {
type: 'resize-corner',
rotation: Math.PI / 4, // 45 degrees
}
// Text editing cursor
const textCursor: TLCursor = {
type: 'text',
rotation: 0,
}
Properties
rotation
The rotation angle in radians, used for rotated cursors like resize handles
rotation: number
type
The cursor type, determining the visual appearance and interaction mode
type: TLCursorType
Prev
TLCameraNext
TLDefaultColorThemeColor