@mocanvas/mocanvas · interface
interface MocanvasPropsThis 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?: AssetStoreWhere 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?: TLAssetUrlsBase 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?: ReactNodeclassName?: stringcolorScheme?: TLColorSchemeLight, 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?: booleanPin the chrome to its narrowest layout, whatever the container's width.
hideUi?: booleanHide mocanvas's own panels. The canvas, and any slot the app filled, still render.
initialState?: stringinitialTheme?: TLThemeIdWhich theme starts out current.
licenseKey?: stringAccepted 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?: TLOnMountHandleronUiEvent?: TLUiEventHandlerReported 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?: TLUiOverridesRewrite the tool and action lists the chrome renders from.
shapeUtils?: readonly ShapeUtilConstructor[]Extra shape utils beyond the defaults.
showStats?: booleanstore?: EditorStoreReuse a store (e.g. for persistence or collaboration).
style?: CSSPropertiestextOptions?: TLTextOptionsRich-text configuration handed to the editor.
themes?: TLThemesInputThemes to register, merged over the built-in default.
tools?: readonly StateNodeConstructor[]Extra tools beyond the defaults.
user?: CurrentUserWho 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.