Force mobile layout

Force the editor UI to render as if it were on a mobile device.

import { Tldraw } from 'tldraw'
import 'tldraw/tldraw.css'

export default function ForceMobileExample() {
	return (
		<div className="tldraw__editor">
			<Tldraw persistenceKey="example" forceMobile />
		</div>
	)
}

/* 
This example shows how you can force the editor to use the mobile breakpoint.
Simply pass the `forceMobile` prop to the editor component.
*/

This example shows how you can force the editor to use the mobile breakpoint's UI layout. To do this, pass the forceMobile prop to the editor component.

Is this page helpful?
Prev
Selection color condition
Next
Infer dark mode