@mocanvas/mocanvas · interface

TldrawUiOrientationContext

interface TldrawUiOrientationContext

Which way a container of controls runs.

A toolbar, a menu and a picker row all need to know this for the same two reasons: which arrow keys move the roving focus, and which CSS axis the children lay out along. Publishing it as context rather than passing a prop lets a button work out its own keyboard behaviour without its parent having to thread the answer through every wrapper in between.


Properties · 2

dir: "ltr" | "rtl"

Writing direction, which flips what "next" means on a horizontal axis.

orientation: "horizontal" | "vertical"

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.