You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/docs/content/docs/collaboration.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,7 @@ Collaboration involves three concerns:
58
58
59
59
-**Synchronizing data** — Getting document changes in and out of the [store](/sdk-features/store). See [Persistence](/docs/persistence) for the basics, or [Collaboration](/sdk-features/collaboration) for building custom sync.
60
60
-**User presence** — Sharing cursor positions, selections, and viewports with other users. See [Collaboration](/sdk-features/collaboration) for presence APIs and [Cursors](/sdk-features/cursors) for customizing how collaborator cursors appear.
61
-
-**Collaboration UI** — The visual elements that show other users on the canvas. See [UI components](/sdk-features/ui-components) for overriding components like `CollaboratorCursor`, `CollaboratorBrush`, and `SharePanel`.
61
+
-**Collaboration UI** — The visual elements that show other users on the canvas. See [UI components](/sdk-features/ui-components) for overriding components like `CollaboratorCursor` and `SharePanel`. Collaborator brushes, scribbles, and hints are rendered via the [OverlayUtil](?) system.
@@ -18,7 +18,7 @@ Indicators are the outlines that appear around shapes when they're selected or h
18
18
19
19
When you select a shape in tldraw, an indicator appears as a stroke around the shape's geometry. Indicators are separate from the shape's visual appearance so they can be styled consistently across all shape types.
20
20
21
-
Each [ShapeUtil](?) defines how its indicator should be drawn by implementing the required `indicator` method:
21
+
Each [ShapeUtil](?) defines how its indicator should be drawn by implementing the required `getIndicatorPath` method:
The `indicator` method returns SVG elements that describe the shape's outline. The editor automatically positions and styles these elements based on selection state.
53
+
The `getIndicatorPath` method returns paths in the shape's local coordinate space. The editor automatically positions and styles these paths based on selection state.
52
54
53
55
## When indicators appear
54
56
@@ -62,48 +64,21 @@ By default, indicators appear in these situations:
62
64
63
65
Indicators are hidden during certain interactions, like when changing styles or during tool operations that would make indicators distracting.
64
66
65
-
## Rendering approaches
66
-
67
-
tldraw supports two ways to render indicators: SVG-based and canvas-based.
68
-
69
-
### SVG indicators (default)
70
-
71
-
The default approach uses React to render indicators as SVG elements. This is simpler to implement. It works well for most shapes:
Canvas indicators are drawn on a single canvas layer. This is more efficient when many shapes are selected. Most built-in shapes use canvas indicators.
81
+
Indicators are drawn on a single canvas layer, which is efficient when many shapes are selected.
| shapeId | TLShapeId | The shape to show an indicator for |
225
-
| userId | string | The collaborator's user ID (for multiplayer) |
226
-
| color | string | Stroke color (default: `var(--tl-color-selected)`) |
227
-
| opacity | number | Opacity from 0 to 1 |
228
-
| className | string | Additional CSS class |
229
-
| hidden | boolean | Whether to hide this indicator |
230
-
231
109
## Collaborator indicators
232
110
233
111
In multiplayer sessions, indicators show other users' selections. These appear with the collaborator's assigned color and slightly reduced opacity. The canvas indicator system handles collaborator indicators automatically.
Canvas overlay elements like the selection foreground, brush, snap indicators, and scribble are rendered via the [OverlayUtil](?) system rather than React components. You can customize them by extending the built-in overlay utils and passing them via the `overlayUtils` prop.
208
+
208
209
See the [TLEditorComponents](?) and [TLUiComponents](?) type definitions for the complete list of customizable components.
Copy file name to clipboardExpand all lines: apps/docs/content/releases/next.mdx
+47-1Lines changed: 47 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ status: published
8
8
last_version: v4.5.10
9
9
---
10
10
11
-
This release adds a first-class theme system with display values for customizing default shapes, extensible asset types via a new `AssetUtil` system, shape attribution with a new `TLUserStore` provider and extensible user records, clipboard hooks for intercepting copy, cut, and paste, custom record types to the store, a new `@tldraw/mermaid` package for converting Mermaid diagrams to native shapes, WebSocket hibernation support for tlsync, a new `@tldraw/editor-controller` package for scripting and automation, RTL language support in the UI, cross-window embedding support, arbitrary iframe embed pasting, a paste-as-plain-text keyboard shortcut, and smarter export trimming. It also includes various other improvements and bug fixes.
11
+
This release adds a first-class theme system with display values for customizing default shapes, a new canvas overlay system that replaces React component overrides with Canvas 2D rendering, extensible asset types via a new `AssetUtil` system, shape attribution with a new `TLUserStore` provider and extensible user records, clipboard hooks for intercepting copy, cut, and paste, custom record types to the store, a new `@tldraw/mermaid` package for converting Mermaid diagrams to native shapes, WebSocket hibernation support for tlsync, a new `@tldraw/editor-controller` package for scripting and automation, RTL language support in the UI, cross-window embedding support, arbitrary iframe embed pasting, a paste-as-plain-text keyboard shortcut, and smarter export trimming. It also includes various other improvements and bug fixes.
12
12
13
13
## What's new
14
14
@@ -229,6 +229,45 @@ A new `Cmd+Shift+V` / `Ctrl+Shift+V` shortcut pastes clipboard content as plain
229
229
230
230
Note: `Cmd+Shift+V`previouslytoggledpaste-at-cursorpositioning. Sincethe"Paste at cursor"preferencenowcoversthatusecase, this shortcut has been repurposed for plain text paste. Users who relied on `Cmd+Shift+V` for paste-at-cursor should use the preference toggle instead.
231
231
232
+
### 💥 Canvas overlay system ([overlay utils](/sdk-features/overlay-utils))
233
+
234
+
Canvas overlay UI — the selection foreground, brush rectangles, snap indicators, shape indicators, shape handles, scribbles, arrow hints, and collaborator presence visuals — is now rendered via a new `OverlayUtil` system instead of React components. Overlays draw directly to a `<canvas>` element using the Canvas 2D API, with optional hit-test geometry for pointer interactions.
235
+
236
+
Pass custom overlay utils through the `overlayUtils` prop on `<Tldraw>` or `<TldrawEditor>`. Custom utils are merged with the defaults; if your util has the same `type`asabuilt-in, it replaces it:
237
+
238
+
```tsx
239
+
import { Tldraw, BrushOverlayUtil, type TLBrushOverlay } from 'tldraw'
240
+
241
+
class BlueBrushOverlayUtil extends BrushOverlayUtil {
The following `TLEditorComponents` entries have been removed: `Brush`, `CollaboratorBrush`, `CollaboratorCursor`, `CollaboratorHint`, `CollaboratorScribble`, `CollaboratorShapeIndicator`, `Cursor`, `Handle`, `Handles`, `Overlays`, `Scribble`, `SelectionForeground`, `ShapeIndicator`, `ShapeIndicatorErrorFallback`, `ShapeIndicators`, `SnapIndicator`, and `ZoomBrush`. Their corresponding default implementations (`DefaultBrush`, `DefaultCollaboratorHint`, `DefaultCursor`, `DefaultHandle`, `DefaultHandles`, `DefaultScribble`, `DefaultSelectionForeground`, `DefaultShapeIndicator`, `DefaultShapeIndicators`, `DefaultSnapIndicator`) and prop types (`TLBrushProps`, `TLCollaboratorHintProps`, `TLCursorProps`, `TLHandleProps`, `TLHandlesProps`, `TLScribbleProps`, `TLSelectionForegroundProps`, `TLShapeIndicatorProps`, `TLShapeIndicatorErrorFallbackComponent`, `TLShapeIndicatorsProps`, `TLSnapIndicatorProps`) have also been removed.
258
+
259
+
If you were overriding these via the `components` prop, create a custom `OverlayUtil` subclass instead and pass it via `overlayUtils`. See the [overlay utils documentation](/sdk-features/overlay-utils) for details.
260
+
261
+
The following `tldraw` canvas helpers have also been removed: `TldrawArrowHints`, `TldrawCropHandles`, `TldrawCropHandlesProps`, `TldrawHandles`, `TldrawOverlays`, `TldrawScribble`, `TldrawSelectionForeground`, and `TldrawShapeIndicators`.
262
+
263
+
Custom shape utils must now implement `getIndicatorPath()`. `indicator()` is deprecated and no longer rendered, and `useLegacyIndicator()` has been removed. Return a `Path2D` (or `TLIndicatorPath` for clipped / multi-path indicators) from `getIndicatorPath()` instead.
264
+
265
+
`TldrawOptions.useCanvasIndicators` has been removed. Shape indicators now always render through `ShapeIndicatorOverlayUtil`; replace that overlay util if you need custom indicator visibility or styling.
266
+
267
+
Custom themes must include the overlay UI colors `snap`, `selectionStroke`, `selectionFill`, `brushFill`, `brushStroke`, `selectedContrast`, and `laser`.
0 commit comments