Table of contents

Public interface

Base props for the Tldraw and TldrawEditor components.

Signature
interface TldrawEditorBaseProps {}
Source

packages/editor/src/lib/TldrawEditor.tsx


Properties

autoFocus

Public propertysignature

Whether to automatically focus the editor when it mounts.

Signature
autoFocus?: boolean

cameraOptions

Public propertysignature

Camera options for the editor.

Signature
cameraOptions?: Partial<TLCameraOptions>
References

TLCameraOptions


children

Public propertysignature

The component's children.

Signature
children?: ReactNode

className

Public propertysignature

A classname to pass to the editor's container.

Signature
className?: string

components

Public propertysignature

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

Signature
components?: TLEditorComponents
References

TLEditorComponents


inferDarkMode

Public propertysignature

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

Signature
inferDarkMode?: boolean

initialState

Public propertysignature

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

Signature
initialState?: string

onMount

Public propertysignature

Called when the editor has mounted.

Signature
onMount?: TLOnMountHandler
References

TLOnMountHandler


shapeUtils

Public propertysignature

An array of shape utils to use in the editor.

Signature
shapeUtils?: readonly TLAnyShapeUtilConstructor[]
References

TLAnyShapeUtilConstructor


tools

Public propertysignature

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

Signature
tools?: readonly TLStateNodeConstructor[]
References

TLStateNodeConstructor


user

Public propertysignature

The user interacting with the editor.

Signature
user?: TLUser

TldrawEditorTldrawEditorProps