@mocanvas/editor · interface

TldrawEditorBaseProps

interface TldrawEditorBaseProps

The props both forms of the editor component accept.

Everything here is about the editor's *behaviour and appearance*; the document itself comes from one of the two branches below.


Properties · 22

assetUrls?: TLAssetUrls

URLs for the fonts the editor should load.

assetUtils?: readonly TLAnyAssetUtilConstructor[]

Asset utils to register: how each kind of attachment is made and resolved.

autoFocus?: boolean

Focus the editor when it mounts.

bindingUtils?: readonly BindingUtilConstructor[]

Binding utils to register.

cameraOptions?: Partial<TLCameraOptions>

The camera's policy.

@deprecated Use options.camera. Kept because it was the only spelling for several versions and removing it would break every app that used it.

children?: ReactNode

Rendered inside the editor's container, above the canvas.

className?: string

A class name for the editor's container.

colorScheme?: "light" | "dark" | "system"

Light, dark, or follow the OS. Defaults to "light".

components?: TLEditorComponents

Replacements for the editor's own components: cursors, grid, error fallbacks.

deepLinks?: TLDeepLinkOptions | true

Mirror the camera into the URL.

@deprecated Use options.deepLinks.

getShapeVisibility?: TLGetShapeVisibility

The host's hook for hiding shapes without deleting them — layers, filters, a review mode. Consulted per shape in the render path, so it must be cheap and pure.

initialState?: string

The id of the tool to start in.

initialTheme?: TLThemeId

Which registered theme starts out current. Defaults to "default".

licenseKey?: string

Accepted and ignored.

mocanvas is MIT-licensed and performs no licence check, paints no watermark and sends no telemetry. The prop exists so that code written against the reference implementation compiles unchanged; passing a key does nothing, and passing none costs nothing.

onMount?: TLOnMountHandler

Called once the editor exists. Return a cleanup for when it goes away.

options?: Partial<TldrawOptions & EditorConfig>

The editor's behavioural options.

overlayUtils?: readonly TLAnyOverlayUtilConstructor[]

Overlay utils to register: the painters for canvas UI drawn over the shapes.

shapeUtils?: readonly ShapeUtilConstructor[]

Shape utils to register.

textOptions?: TLTextOptions

Rich-text configuration.

@deprecated Use options.text. The two are the same object.

themes?: Partial<TLThemes>

Named themes to register, merged over the built-in default.

tools?: readonly StateNodeConstructor[]

Tools to add to the editor's state chart.

user?: CurrentUser

Who is using the editor, as the owner of their preferences.

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.