@mocanvas/editor · interface

UserPreferencesState

interface UserPreferencesState

The local person's settings, as one plain serializable object.

Everything but id is optional and *stays* optional: a host that owns this object (see CurrentUser) writes down only the settings it has an opinion about, and UserPreferencesManager fills the rest from USER_PREFERENCES_DEFAULTS. Leaving a key out is therefore meaningfully different from setting it — it means "whatever the editor's default is".

The integrator exposes this as TLUserPreferences. It is *not* the older accessor-style UserPreferences in records/presence.ts, which UserPreferencesManager also satisfies so the two can coexist while the editor migrates.


Properties · 13

animationSpeed?: number

Multiplier on camera and shape animations. 0 disables them.

areKeyboardShortcutsEnabled?: boolean

Whether keyboard shortcuts are active.

color?: string

CSS colour for the cursor, name chip and selection outlines.

colorScheme?: ColorScheme
edgeScrollSpeed?: number

Multiplier on how fast the camera scrolls when dragging past the viewport edge.

id: UserId

Stable id for this person. Presence records are attributed to it.

A branded UserId: pass createUserId(myAccountId) rather than a bare string, so that an id minted here and an id read off a presence record are the same kind of thing.

isDynamicSizeMode?: boolean

Scale newly placed shapes by 1 / zoom, so they look the same size at any zoom level. Off means a shape is always created at its nominal size.

isEnhancedA11yMode?: boolean

Announce more than the minimum to a screen reader.

The plain announcement names the selection and nothing else ("rectangle selected"); with this on it also carries position and size, which is what a keyboard user otherwise has no way to read back.

isPasteAtCursorMode?: boolean

Paste at the pointer rather than at the centre of the viewport.

isSnapMode?: boolean

Snap shapes to other shapes and to the grid while dragging.

isWrapMode?: boolean

Wrap long text instead of growing the shape.

locale?: string

BCP-47 tag for UI text and number formatting.

name?: string

Display name on the cursor chip.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.