@mocanvas/editor · interface
interface TldrawEditorBasePropsThe 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?: TLAssetUrlsURLs for the fonts the editor should load.
assetUtils?: readonly TLAnyAssetUtilConstructor[]Asset utils to register: how each kind of attachment is made and resolved.
autoFocus?: booleanFocus 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?: ReactNodeRendered inside the editor's container, above the canvas.
className?: stringA class name for the editor's container.
colorScheme?: "light" | "dark" | "system"Light, dark, or follow the OS. Defaults to "light".
components?: TLEditorComponentsReplacements for the editor's own components: cursors, grid, error fallbacks.
deepLinks?: TLDeepLinkOptions | trueMirror the camera into the URL.
@deprecated Use options.deepLinks.
getShapeVisibility?: TLGetShapeVisibilityThe 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?: stringThe id of the tool to start in.
initialTheme?: TLThemeIdWhich registered theme starts out current. Defaults to "default".
licenseKey?: stringAccepted 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?: TLOnMountHandlerCalled 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?: TLTextOptionsRich-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?: CurrentUserWho 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.