Back to Tldraw

External UI (using context)

apps/examples/src/examples/layout/external-ui-context/README.md

5.0.0454 B
Original Source

This example shows how to control the tldraw editor from an external UI, using React context.


This example shows how to control the tldraw editor from an external UI, outside of the Tldraw component. There are a few ways of doing this—for example, by putting the editor on the window object, passing it around via props, or using React context.

In this example, we use React context to distribute a reference to the editor to child components.