TldrawEditorBaseProps

See source code
Table of contents

Base props for the Tldraw and TldrawEditor components.

interface TldrawEditorBaseProps {}

Properties

autoFocus

optional

Whether to automatically focus the editor when it mounts.

autoFocus?: boolean

bindingUtils

optional

An array of binding utils to use in the editor.

bindingUtils?: readonly TLAnyBindingUtilConstructor[]

cameraOptions

optional

Camera options for the editor.

cameraOptions?: Partial<TLCameraOptions>

children

optional

The component's children.

children?: ReactNode

className

optional

A classname to pass to the editor's container.

className?: string

components

optional

Overrides for the editor's components, such as handles, collaborator cursors, etc.

components?: TLEditorComponents

optional

Options for syncing the editor's camera state with the URL.

deepLinks?: TLDeepLinkOptions | true

inferDarkMode

optional

Whether to infer dark mode from the user's OS. Defaults to false.

inferDarkMode?: boolean

initialState

optional

The editor's initial state (usually the id of the first active tool).

initialState?: string

licenseKey

optional

The license key.

licenseKey?: string

onMount

optional

Called when the editor has mounted.


options

optional

Options for the editor.

options?: Partial<TldrawOptions>

shapeUtils

optional

An array of shape utils to use in the editor.

shapeUtils?: readonly TLAnyShapeUtilConstructor[]

textOptions

optional

Text options for the editor.

textOptions?: Partial<TLTextOptions>

tools

optional

An array of tools to add to the editor's state chart.

tools?: readonly TLStateNodeConstructor[]

user

optional

The user interacting with the editor.

user?: TLUser

Methods

isShapeHidden

optional

Predicate for whether or not a shape should be hidden.

Hidden shapes will not render in the editor, and they will not be eligible for hit test via and . But otherwise they will remain in the store and participate in all other operations.

Parameters

NameDescription

shape

editor

Returns

boolean

Prev
TLDeepLinkOptions
Next
TldrawEditorWithoutStoreProps