@mocanvas/mocanvas · interface

MocanvasProps

interface MocanvasProps

This one ships without a description. The signature above is read from the package, and the guides cover the area it belongs to.


Properties · 26

assets?: AssetStore

Where asset bytes live. Threaded to both the store this component creates and the editor, so a dropped image is uploaded through the app's own storage. Ignored for the store when store is supplied — that store already carries its own.

assetUrls?: TLAssetUrls

Base paths for files an app self-hosts, published for chrome that needs them via useAssetUrls(). mocanvas's own chrome loads none.

bindingUtils?: readonly BindingUtilConstructor[]

Extra binding utils beyond the defaults.

canvasComponents?: CanvasProps["components"]

The much smaller *canvas* override map — the selection indicators, the brush, the canvas backdrop. A different thing from components, which is chrome; these are drawn on the canvas surface itself.

children?: ReactNode
className?: string
colorScheme?: TLColorScheme

Light, dark, or follow the host window.

components?: TLComponents | TLUiComponents | (TLComponents & TLUiComponents)

Replace or remove a component.

Two maps reach this prop and their slot names are disjoint: the editor's canvas-level slots (TLComponents) and the UI chrome's panels (TLUiComponents). It accepts either or both — an intersection alone would reject a value already typed as just one of them, because neither is assignable to the other.

forceMobile?: boolean

Pin the chrome to its narrowest layout, whatever the container's width.

hideUi?: boolean

Hide mocanvas's own panels. The canvas, and any slot the app filled, still render.

initialState?: string
initialTheme?: TLThemeId

Which theme starts out current.

licenseKey?: string

Accepted and ignored. mocanvas's licence is a written agreement rather than a key the canvas verifies at runtime, so there is nothing to check; the prop exists so an app migrating from a licensed canvas does not have to strip it from every mount, and so that leaving it in place stays a no-op rather than becoming a type error.

onMount?: TLOnMountHandler
onUiEvent?: TLUiEventHandler

Reported UI events — a menu opened, an action run.

options?: ConstructorParameters<typeof Editor>[0]["options"]

Editor config overrides.

overlayUtils?: readonly TLAnyOverlayUtilConstructor[]

Replace the canvas overlay painters. Defaults to defaultOverlayUtils; pass your own list to swap one out or drop it.

overrides?: TLUiOverrides

Rewrite the tool and action lists the chrome renders from.

shapeUtils?: readonly ShapeUtilConstructor[]

Extra shape utils beyond the defaults.

showStats?: boolean
store?: EditorStore

Reuse a store (e.g. for persistence or collaboration).

style?: CSSProperties
textOptions?: TLTextOptions

Rich-text configuration handed to the editor.

themes?: TLThemesInput

Themes to register, merged over the built-in default.

tools?: readonly StateNodeConstructor[]

Extra tools beyond the defaults.

user?: CurrentUser

Who is using this editor: the app-owned holder of their preferences. Pass one to control preferences from app state; omit it and the editor keeps its own.

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.