@mocanvas/editor · interface
interface UserPreferencesStateThe 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?: numberMultiplier on camera and shape animations. 0 disables them.
areKeyboardShortcutsEnabled?: booleanWhether keyboard shortcuts are active.
color?: stringCSS colour for the cursor, name chip and selection outlines.
colorScheme?: ColorSchemeedgeScrollSpeed?: numberMultiplier on how fast the camera scrolls when dragging past the viewport edge.
id: UserIdStable 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?: booleanScale 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?: booleanAnnounce 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?: booleanPaste at the pointer rather than at the centre of the viewport.
isSnapMode?: booleanSnap shapes to other shapes and to the grid while dragging.
isWrapMode?: booleanWrap long text instead of growing the shape.
locale?: stringBCP-47 tag for UI text and number formatting.
name?: stringDisplay 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.