Back to Tldraw

External UI (using state)

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

5.1.1597 B
Original Source

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


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'll just put the editor instance in state and use it in the same component. See the other External UI example for an alternative (and more realistic) solution using React context.