@mocanvas/mocanvas · function

useExternalContent

declare function useExternalContent(editor: Editor | null, containerRef: RefObject<HTMLElement | null>, options?: ExternalContentOptions): void

Drop and paste support for the canvas container: files, images, svg markup, urls and plain text are routed to editor.putExternalContent. Plain text is only taken when nothing is being edited and it is not our own application/mocanvas clipboard JSON (the keyboard shortcuts handle that). Also installs the default handlers for any content type without one.

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.