Reference · 1,241 exports · mocanvas 4.11.2

@mocanvas/mocanvas

The flagship: the canvas component, the built-in shapes and tools, and the default UI.

Read out of the type declarations inside the published package, so a name here is a name in the version above — and its description is the one written next to the code.

1241 of 1241

Marks the anchor each bound terminal of the selected arrow is attached to.

Keeps arrows attached to the shapes their terminals are bound to.

Outlines the shape an arrow terminal is about to bind to.

Drag to draw an arrow; dropping the end on a shape binds it to that shape.

Drag out a box shape, or click to place a default-sized one.

The half a brush painter shares with the other one: read a rectangle off the instance record, name it, stroke it in page space.

Bookmarks: a link with a title, description and preview image.

Paints the select tool's brush.

The shared half of the three utils below.

Another person's selection brush, in their colour.

Other people's pointers, with their names beside them.

The marker on the viewport edge that says a collaborator is off screen, and which way they are.

The half every collaborator painter shares: who to draw, and how faded.

Another person's live scribbles — their laser, their eraser trail.

Outlines round the shapes another person has selected.

Freehand drawing.

Delete shapes by dragging over them.

Drag out a frame, or click to place a default-sized one.

GeoTool

class

Draw a geo shape (rectangle, ellipse, ...) by dragging.

A container with no visuals of its own; its bounds are the union of its children.

Pan the camera by dragging.

Draw a translucent marker stroke over what is already on the canvas.

A translucent marker stroke, drawn behind the shapes it marks.

Image files: raster and SVG, downsized to the configured maximum.

Point at things: a fading trail that never becomes a shape.

Drag for a straight line, or click repeatedly for a multi-segment one.

Click to place a sticky note.

One run of a path, as a `Geometry2d` the editor can hit-test, snap to and export.

Paints every live scribble.

Paints, and hit-tests, the selection box and its handles.

Selection, brush select, drag-to-move, resize, rotate, and shape handle dragging.

Paints, and hit-tests, the handles of the single selected shape.

Paints every selection, hover and drop-target outline onto the canvas overlay in a single pass.

Paints the snap guides `editor.snaps` published for the drag in flight.

Measures runs of text with a hidden DOM element, mirroring the CSS the `<TextLabel>` component uses (pre-wrap + break-word, border-box padding).

Click to place a text shape and start typing.

Video files.

The zoom tool's brush: the rectangle you drag to zoom to a region.

Click, alt-click or drag a box to move the camera.

The accessibility preferences.

actionKeyMap

function

`{ normalized binding: actionId }` for every action that declares one.

Component form, so the hook can be mounted from inside the UI provider.

The six alignment items.

Fold a plain-text edit back into a rich-text document.

Approximate a circular arc with `count` cubic béziers.

Align, distribute, stack, stretch and flip, as one submenu.

asRichText

function

The rich-text document form of any label source; a string is converted, a document passed through.

Geometry for the body: a polyline (straight or elbow) or a cubic approximation of the arc.

boxPath

function

A rectangle at an offset, for a geometry whose bounds do not start at the origin.

Measures the editor's container and publishes its breakpoint.

Build the default action list for an editor.

Build the default tool list for an editor.

Every binding in the table, indexed by its normalized form.

canBuildPath

function

Whether canvas paths can be built at all.

canPrint

function

Whether there is anything on the current page to print.

Whether this environment can decode an image into a texture source at all.

Convert a polyline into a smooth cubic spline that passes through every point (uniform Catmull-Rom, tension 0.5, converted to bézier handles).

Centres a panel across the top, between whatever is docked left and right.

Move the selection so its centre sits at `position`.

Classify pasted or dropped plain text as our own clipboard JSON (`null`), a url, svg markup, or text.

Forget the current target.

Cut / copy / paste, as one group.

computeGrowY

function

Extra height a box needs so its label fits: `labelHeight - boxHeight`, never negative.

Fit `box` inside `container` without changing its aspect ratio.

Copy-as and export-as, as one group.

copyAs

function

Put a rendered copy of the shapes on the system clipboard.

"Copy as" — the rendered formats, plus mocanvas's own content JSON.

Copy `blob` to the system clipboard.

CopyMenuItem

function

Copy the selection.

Copy the selection.

Create a bookmark shape for `url`, centred on `center`.

Create the `bookmark` card for a url, storing `asset` when the unfurl produced one.

Create a boolean flag.

Create a flag of any type.

Create the `embed` shape for an already-matched url, centered on `point`.

Create a bookmark card for `url` with no asset behind it yet.

Register a feature flag.

Build (without storing) an image asset for a file; `undefined` for non-image files.

Build (without storing) an image asset from SVG markup.

Store `assets` and create one image shape per asset, centered on `point` and stacked by `stackOffset`.

Store `assets` and create the shape each one calls for, centred on `position` and stacked so several dropped files do not land exactly on top of one another.

Create a text shape whose bounds are centered on `point`.

The cursor-chat entry field.

CutMenuItem

function

Cut the selection.

Copy the selection, then delete it.

dashArray

function

`stroke-dasharray` for an engine dash id (0 solid, 1 dashed, 2 dotted, 3 draw).

DebugFlags

function

The debug flag list.

The live region itself: two of them, one per priority, because a region's politeness cannot change after it is announced into.

The selection-actions menu: a grid of icon buttons.

The actions menu's items: alignment, distribution, reordering.

The built-in rich-text font visitor: work out which face a node needs, register it, and pass the resulting state to the node's children.

The right-click menu.

The right-click menu's items.

The debug menu.

The debug menu's items.

Renders the dialog stack into the editor's container.

A url the caller has already decided to embed, skipping the bookmark negotiation.

The default handler for Excalidraw content arriving on the clipboard.

Build an asset record for a file, without creating any shape.

Files: turn each one into an asset through the util that claims its type, then create the shapes those assets call for.

Replace the asset behind an existing shape with one built from `file`.

SVG markup: one image shape backed by an inline SVG asset.

Plain text: one text shape, centred where it was dropped.

mocanvas's own clipboard content: shapes, bindings and assets, put back onto the current page.

Build a bookmark asset for a url, without creating any shape.

Handle a url that arrived from outside the editor.

The strip of contextual helper buttons above the toolbar.

The helper buttons' items: "back to content", shown only when there is content and none of it is on screen.

The help menu.

The help menu's items.

The image bar's buttons: aspect ratio, and replace.

The dialog frame.

Every shortcut the editor is listening for, grouped.

The top-left menu.

The main menu's items.

The top-left plate: the main menu, the page picker, and — where there is room for them — the common actions.

The zoom cluster, and the minimap above it on wide layouts.

One person's avatar: their colour, and their initials.

The overlapping avatars on the people menu's trigger.

One row in the collaborator list; clicking it follows that person's camera.

The always-visible row of common actions, and the row the actions menu rides at the end of.

The quick-actions row's items.

The formatting buttons.

The pickers, in the order the panel shows them.

The toast stack.

The toolbar plate.

The default set of toolbar buttons, in order.

The toolbar, with the mobile style trigger beside it on narrow layouts.

DefaultUi

function

mocanvas's chrome, and the context every part of it reads.

The video bar's buttons: play/pause and loop, written onto the shape.

The zoom menu; its trigger shows the current zoom level.

The zoom menu's items.

Delete the selection.

The two distribute items.

downloadBlob

function

Trigger a download of `blob` as `filename`.

Scale `size` down — never up — so neither side exceeds `max`, keeping the aspect ratio.

Re-encode an image blob at `width`×`height`.

Duplicate the selection.

The edit submenu's items, without the submenu frame.

The `allow` attribute for an iframe, built from a permissions map.

The `allow` attribute for `permissions`, or `undefined` when nothing is granted.

escapeHtml

function

Escape text for insertion into HTML/XML character data or an attribute value.

escapeXml

function

Escape text for use inside an element or a double-quoted attribute.

Estimate the box a run of text occupies at `fontSize`, wrapping each paragraph at `maxWidth` using an average character width.

A confirm/cancel dialog, complete.

exportAs

function

Render the shapes and hand the file to the browser's downloader.

"Export as" — writes a file through the browser's downloader.

Export the whole document as a `.mocanvas` file.

exportToBlob

function

Render the export to a `Blob`.

ExtrasGroup

function

The odds and ends at the bottom of the main menu.

FeatureFlags

function

The feature flag list.

Resize a frame — or any frame-like container — so it fits its children, with `padding` around them.

fitImageSize

function

Scale `size` down (never up) so both sides fit within `max`, keeping the aspect ratio.

Affinely stretch points so their bounding box becomes exactly [0,w]×[0,h].

A positioned, dismissable layer portalled into the editor's container.

Outline drawn with the render style, or a hairline in the theme text colour when the shape has none.

One `<path>` per leaf geometry, filled only where the leaf is a closed, filled outline and stroked with the shape's stroke.

Map a normalized anchor `(0..1, 0..1)` into a shape's geometry bounds (shape-local space).

The arrow's terminal bindings, keyed by terminal.

The topmost shape an arrow terminal dropped at `pagePoint` should bind to, or `undefined`.

getArrowBody

function

Describe the body running from `start` to `end`, bowed by `bend`.

Resolve an arrow's display values; see {@link ArrowShapeUtilDisplayValues}.

Arrowhead geometry with its tip at `tip`, pointing along unit `dir` (from the body outward).

How far the body must retreat from the tip so it ends at the head's base.

Arrowhead length for a stroke width, capped so two heads never overlap.

getArrowInfo

function

Resolve an arrow to the geometry everything downstream draws from.

What the arrow is currently pointing at, or `null` when it is over empty canvas.

The gap in page units for an arrow of a given size style.

Resolve both terminals of an arrow in arrow-local space.

getAssetInfo

function

The size and mime type of an asset, for a shape that is placing it.

Signed bend for a dragged midpoint handle at `point`.

The shape's `bookmark` asset, or `null` when it has none (or one of another type).

The host a bookmark points at, without a `www.` prefix — the one line of a link card that is always available, since it comes from the shape's own url rather than from a scrape.

For each bound terminal, the axis of the normal of the bound shape's nearest edge: `"x"` on a left or right edge, `"y"` on a top or bottom one.

The breakpoint a container of `width` CSS px is in.

Serialize the given shapes (default: the selection) as clipboard text.

A ring of round bumps around an inner ellipse, fitted to the box.

The colour choices, with their light-theme swatches.

getCropBox

function

The shape update one step of a crop drag produces, or `undefined` when the drag would change nothing.

getDashId

function

Engine dash pattern id for a dash style (see `mocanvas-render::dash`).

Every registered flag.

The best match for a browser locale among {@link LANGUAGES}, falling back to English.

The axis a free terminal leaves on: the one the terminals are further apart on.

Resolve a draw shape's display values against a theme.

Flatten a draw shape's segments to one outline, smoothing freehand runs.

The four sides of `box` as the router sees them.

The two ends and their union; see {@link ElbowArrowBoxes}.

Route an elbow arrow between two ends, and report everything the routing was derived from.

The axis a leg attached to `side` runs along.

Which side of `box` the point `to` sits off, or `null` when it is inside.

One end of an arrow as a target box.

getElbowBody

function

The elbow body for an arrow: the rounded route as a polyline body.

`elbowMidPoint` for a midpoint handle dragged to `point`: how far along `axis` it sits between the terminals, clamped to `0..1`.

Route an elbow from `start` to `end`.

The permit-list entry for `url`, with the url to actually put in the iframe, or `null` when the url is not one we embed.

Resolve an embed's display values; see {@link EmbedShapeUtilDisplayValues}.

getEmbedInfo

function

Resolve a url against a permit list, in both directions.

Common page bounds of the shapes, or `undefined` when there are none.

The shapes an export covers: the given ids (or the selection, or the whole page when nothing is selected) together with all of their descendants, in page draw order.

getFillRgba

function

Engine RGBA for a shape's interior.

The CSS font stack a font style resolves to, in `theme`.

The font choices.

Resolve a frame's display values; see {@link FrameShapeUtilDisplayValues}.

Open polylines drawn inside the outline (the X of an x-box, the tick of a check-box).

Resolve a geo shape's display values; see {@link GeoShapeUtilDisplayValues}.

Build the outline geometry for a geo kind inside a w×h box.

getGeoGrowY

function

`growY` a geo shape needs so its label fits inside `h`.

The box a geo icon's outline is fitted into, in grid units.

Polygon vertices for the polygonal geo kinds, or `null` for the curved kinds (ellipse, oval, cloud, heart).

The definition for a geo type, or `undefined` when nothing defines it.

getHatchRgba

function

Engine RGBA for a fill style's hatch, or 0 when that style has no hatch.

Classic two-lobed heart, six cubics, bounds exactly w×h.

Resolve a highlight's display values against a theme.

The stroke as one polyline, freehand runs smoothed.

The shape under the pointer, as a click should resolve it.

CSS for the `<img>` so the crop window fills the shape's box; `null` crop shows the whole image.

Resolve an image shape's display values; see {@link ImageShapeUtilDisplayValues}.

Texture cache key for the shape's pixels, or `null` when it must stay on the DOM overlay.

The source the shape's pixels come from: the asset's `src` (a URL or data URL), or `null` when the shape has no asset yet or the asset is still uploading.

The typefaces a label in `font` needs: the four `[style][weight]` faces of that family.

The lift in px for a label, given the same options `measureLabel` takes.

Resolve a line's display values; see {@link LineShapeUtilDisplayValues}.

The line's points in drawing order, skipping any entry that is not a point.

Normalize a page point into a shape's geometry bounds, clamped to `[0, 1]`.

The label's size before any shrinking: the size style, scaled.

CSS `background` for a note body: the vertical gradient, top to bottom.

Resolve a note's display values against a theme.

CSS colour at the bottom of a note's body gradient (the palette's note fill).

Engine RGBA for a sticky note's background.

Effective font size: the size style, shrunk by `fontSizeAdjustment`.

CSS colour at the top of a note's body gradient.

Top of a note's body gradient, derived from the colour at its bottom.

getNoteGrowY

function

`growY` a note needs so its (centered) text fits; the note keeps its square width.

CSS `box-shadow` for a note body, in shape-local units at `scale`.

The note shadow's geometry for an SVG export, in shape-local units.

CSS color string for text on a sticky note.

Flattened outline of a geometry as line segments, in the geometry's own space.

Point at parameter `t` in [0, 1] along the body.

The points of one segment, scaled by `scaleX`/`scaleY`, appended to `points`.

Every point of a stroke, in order, scaled to the shape's current size.

The registered rich-text editor factory, or `null` when labels edit as plain text.

The rich-text extension list an editor is configured with, or the default set.

Stadium / capsule: two semicircles joined by straight sides.

getStroke

function

The polygon surrounding `points` — {@link getStrokePoints} then {@link getStrokeOutlinePoints}.

Walk the stroke points and produce the polygon that surrounds them.

Resample and smooth raw input into the points the outline is built from.

Engine RGBA for a shape's stroke.

Choices built from an enum style prop, labelled by title-casing its values.

Decide which rows the style panel shows for the editor's current state.

The centreline of a stroke as an SVG `d`, drawn with quadratic curves through the midpoints between samples.

getSvgString

function

Serialize shapes to an SVG string.

Pixel size declared by an SVG's root `width`/`height` or `viewBox`, or `null` when neither is usable.

Unit direction of travel at parameter `t`.

CSS color string for text drawn in the DOM overlay.

Resolve a text shape's display values; see {@link TextShapeUtilDisplayValues}.

The shared measurer.

The box `getGeometry` produces: what a texture for this shape must cover.

Height of the text block at its current width.

Width and height of a text shape: measured (auto-size) or wrapped at `w`.

Measured size of a text shape: intrinsic when `autoSize`, else wrapped at `w`.

The rasterization spec for a text shape at the editor's current resolution bucket.

Cache key for a spec.

Effective resolution after clamping the canvas to `MAX_TEXT_TEXTURE_PX`.

getTheme

function

The theme `source` is currently painting with, or the built-in one.

The ramp `source` is currently painting with; see {@link getTheme}.

mocanvas's default TipTap extension set, with `StarterKit` configured.

Resolve a video shape's display values; see {@link VideoShapeUtilDisplayValues}.

The play triangle's points, centred in a `w`×`h` box.

The file the shape plays: the asset's `src`, or `null` when there is no asset yet, the asset is still uploading, or it is not a video.

The table's rows, in the order the sections are shown.

Group the selection.

hairline

function

A width given in CSS pixels, expressed in the page units the camera transform is about to scale.

Write the current selection to the clipboard, from either a native copy event or a menu item.

Whether any row at all is on.

hasGeoFlip

function

Whether `flip` asks for anything at all.

hexToCssRgba

function

`#rrggbb` as a CSS `rgba()` string at `alpha`.

Dismiss whatever tooltip is on screen.

Provides {@link ActionRowIsHosted}.

Icon

function

Renders one icon from the set.

Intersection point of segments `a1-a2` and `b1-b2`, or `null` when they do not cross.

Whether `content` looks like an Excalidraw clipboard payload.

isImageFile

function

Whether `value` lies inside `span`, inclusive.

isolate

function

Save the paint state, run `draw`, restore.

isRichText

function

Whether `value` is a rich-text document rather than a string or junk.

Whether a locale is written right to left.

isSvgFile

function

Whether a video may start itself.

kbdToKeys

function

Split a shortcut into the keys to draw.

The form the dialog stack wants: a component taking `onClose`.

Open the keyboard shortcuts dialog.

The label's font style token, from either spelling.

The label's font style token, from either spelling, defaulting to `draw`.

The stretch of `body`, as a parameter range, that runs inside `box` — the gap the *selection outline* leaves around a label.

The label's horizontal alignment, from either spelling.

lineSegment

function

A straight line expressed as a cubic (control points at 1/3 and 2/3).

Decode an image `src` (URL or data URL) into something the GPU can sample.

Load a `.tldr` file (text or parsed JSON) into the editor, replacing the document.

Load TipTap's `StarterKit` so {@link getTipTapDefaultExtensions} can return real extensions.

Load TipTap's own starter extensions, for an app that has the optional peer dependency installed and wants the standard set rather than mocanvas's descriptions.

LockGroup

function

Lock, and unlock-all, as one group.

looksLikeSvg

function

looksLikeUrl

function

matrixAttr

function

`matrix(a b c d e f)` for a `transform` attribute.

Measured size of a geo label (padding included), wrapped at the shape width.

measureLabel

function

Measure a shape label with the shared measurer using the default label typography.

Measure a rich-text value directly: render it, then hand it to the shared measurer.

Mirror `points` about the centre of the `w × h` box on the requested axes.

{@link mirrorPointsInBox} for cubic segments: every control point moves with its anchors.

The bottom group of the context menu.

Mocanvas

function

One UI item rendered as a button — the thing a toolbar is made of.

normalizeKbd

function

Normalize an authored binding into the same shape {@link bindingString} makes.

Whether `file` may be turned into an asset — and if not, say so on screen.

The "you are offline" chip.

Create a shape at the end of a drag that started on the toolbar.

A toolbar that moves whatever will not fit into a "more" popover.

The rename field on a page row.

The per-page actions: rename, duplicate, delete.

Parse `.tldr` JSON text without loading it into an editor.

Put whatever mocanvas content is on the clipboard onto the current page.

Paste at the viewport centre, or at the pointer when that mode is on.

Convert the engine's flat path encoding to an SVG `d` attribute (for indicators).

placeNear

function

Place `box` next to `anchor`, on the preferred side if it fits there and on the other side if it does not, then clamp the result inside the viewport.

The editable surface behind a plain-text label.

A shape's label, as plain text.

pointOnCubic

function

Evaluate a cubic segment at `t`.

polylinePath

function

An open or closed polyline through `points`.

Popover

function

A dismissable floating grid anchored to a button.

The preferences, behind one row of the main menu.

preloadFont

function

Load a font into a document and register it under `id`.

Print the drawing: the selection if there is one, otherwise the page.

propsOf

function

A shape's props as a bag of unknowns, tolerating a missing or non-object `props`.

Put Excalidraw clipboard content onto the current page, centred on `point`.

readArray

function

An array prop; a missing or non-array value reads as empty.

The shape with every declared prop present and of the declared type.

readBoolean

function

The shape's segments in a usable form.

readEnum

function

A string prop constrained to a known set; anything else falls back.

Read a file into a `data:` URL, via `FileReader` where present and `arrayBuffer()` elsewhere.

readGeoProps

function

The pixel size of an image from its source.

readNumber

function

readPoint

function

A `{ x, y }` prop, with each coordinate falling back independently.

readRecord

function

A record-of-objects prop (a line's points, say); anything else reads as empty.

readRichText

function

A shape's label as a rich-text document — the reader every other label read goes through.

readString

function

readStyle

function

A style prop's value, validated against the style's own set of values.

readText

function

A shape's label as plain text.

rectPath

function

A rectangle, optionally rounded.

Puts `data-reduce-motion` on the editor's container while motion is reduced, so `ui.css` can switch off the chrome's transitions.

Install the default drop/paste behaviour: image files become image assets + image shapes, SVG markup becomes an image asset, text and urls become text shapes.

Install the default side effects and return a function that removes them.

Tool ids the editor currently has registered.

Install the WYSIWYG editing surface used when a label is being edited.

Register (or replace) the SVG renderer for a shape type.

removeFrame

function

Remove the frames among `ids`, keeping what was inside them.

A rich-text document as HTML.

Render a rich-text value to the HTML the text measurer sizes.

Render a rich-text value to HTML with an **explicit** extension list.

A rich-text document as plain text.

Parse HTML into a rich-text document.

Draw the label onto a canvas covering the whole `width × height` box, so the engine's uv `0..1` quad over the shape's local bounds lands pixel-for-pixel.

The four reorder items.

Reordering, as a submenu.

Resolve one scribble's colour.

The style panel in whichever form the layout calls for.

rgbaToHex

function

Convert an engine `0xRRGGBBAA` word to `#rrggbb` (opaque) or `#rrggbbaa`.

RichTextArea

function

The editable surface behind a rich-text label.

Structural equality of two documents, by value.

A shape's label, as a rich-text document.

RichTextSVG

function

A rich-text label as SVG markup.

Flatten a document to the blocks the renderers draw: one block per top-level block node (a paragraph, a heading, a list item), each a list of styled runs.

Serialize a rich-text document to HTML.

The plain string a label reads as, whatever it was given.

Rotate the selection a quarter turn clockwise.

`corners` with every interior corner replaced by a fillet of `radius`.

safeHref

function

A link `href` that is safe to render, or `null` when the scheme is not allowed.

sanitizeSvg

function

Sanitize an SVG document, returning the cleaned markup — or `null` when the input was not SVG at all, or when nothing survived.

Select everything on the page.

Runs {@link useSelectedShapesAnnouncer}.

The editor's document as `.tldr` JSON text.

The same document as a `Blob`, ready to hand to a downloader or an upload.

A shape's backdrop in shape-local space, drawn behind *every* exported shape.

shapeToSvg

function

Render a shape to SVG markup in shape-local space.

shortenBody

function

Trim `startBy` / `endBy` page units from either end of the body.

smoothPoints

function

One pass of a light 1-2-1 moving average over a freehand stroke.

The two stack items.

Put a shape into text-editing mode from outside the label.

The two arrowheads.

How an arrow's body is routed.

{@link StylePanelButtonPickerInline} with its label row.

A row of buttons, one per value: the shape for a style with four or five choices that each have a glyph — fill, dash, size, alignment.

Shape colour.

Dash style.

{@link StylePanelDoubleDropdownPickerInline} with its label row.

Two dropdowns under one label: the arrowheads, which are two styles but one decision, and which read as unrelated when split into two rows.

{@link StylePanelDropdownPickerInline} with its label row.

A button that opens a grid of choices: the shape for a style with too many values to sit in a row — the twenty geo kinds, most obviously.

Fill style.

Font family.

The geo kind.

Where the label sits inside its shape.

A band of related rows, ruled off from its neighbours.

Stroke size.

How a line interpolates between its points.

A row's label, with the "mixed" marker when the selection disagrees.

svgPath

function

A path from SVG path data.

Markup for a value returned by `toSvg` / `toBackgroundSvg`: a string is used verbatim, a React node is serialized, and React's empty values become `undefined` so the caller can fall through to the next renderer.

A `data:` URL for an SVG document string.

TextLabel

function

A shape's text label.

Horizontal alignment of a spec, from either spelling.

The plain text of a spec: the document's text when it has one, else `text`.

textToSvg

function

Render `source` inside `box`.

TldrawImage

function

A snapshot as an inline SVG.

TldrawUi

function

mocanvas's chrome, and every context it reads.

Holds the announcement queue.

Publishes an action list to its subtree.

A button.

The tick at the end of a checkbox menu row.

The icon slot inside a {@link TldrawUiButton}.

The text slot inside a {@link TldrawUiButton}.

A vertical stack of controls.

Publishes the UI chrome map.

Mounts the UI contexts.

A floating toolbar anchored to a page-space box.

A dialog's scrollable middle.

The dialog's close affordance.

A dialog's button row.

A dialog's title bar.

Holds the dialog stack.

A dialog's title.

A row that toggles.

The menu panel.

A run of related rows.

The dot marking the chosen entry in a radio group.

A plain row.

The pair's root.

A nested menu's root.

A nested menu's panel.

The row that opens a nested menu.

The control that opens the menu.

Publishes `onEvent` to {@link useUiEvents}.

TldrawUiGrid

function

A fixed-column grid: colour swatches, geo kinds, the shortcuts dialog.

TldrawUiIcon

function

An icon, from the built-in set, from a URL, or as a fallback initial.

A slot for whatever an app wants drawn over the canvas but under the panels.

A labelled text input that commits on Enter and reverts on Escape.

TldrawUiKbd

function

A shortcut as a row of `<kbd>` elements.

A checkbox menu item driven by the action list.

A menu item driven by the action list.

A menu item that toggles.

Tells the items inside it what shape to take.

A run of related items, with a rule between it and the next.

One menu item, in whatever shape its context calls for.

A nested menu.

A menu item driven by the tool list, showing whether its tool is active.

Publishes an orientation to everything inside it.

The pair's root.

The panel.

The control that opens the panel.

TldrawUiRow

function

A horizontal run of controls.

The picker's root.

The option list.

One option.

The control showing the current value.

The current value, rendered from whichever item registered it.

A range input.

Holds the toast list.

A `role="toolbar"` container with roving focus.

A button inside a {@link TldrawUiToolbar}.

A run of mutually-exclusive (or multi-select) toolbar buttons.

One entry in a {@link TldrawUiToolbarToggleGroup}.

Publishes a tool list to its subtree.

Attaches a tooltip to its child.

Hosts the shared tooltip layer.

Resolves the editor's current locale into a {@link TLUiTranslation} and publishes it.

Text exactly as the static label / measuring element must render it to occupy the right box.

Lift the polyline `elbow-helpers` produced into the documented route shape.

Show the frame-statistics chip and the debug menu.

Scale new shapes so they look the same size at any zoom.

Scroll the camera when dragging past the viewport edge.

Hide the chrome.

Show the grid.

Keyboard shortcuts on or off.

Lock or unlock the selection.

Paste at the pointer rather than at the viewport centre.

Turn off animation: the chrome's transitions and the camera's easing.

Snap to other shapes while dragging.

Keep the current tool after drawing a shape.

Export with a transparent background.

Wrap long text instead of growing the shape.

toolKeyMap

function

`{ key: toolId }` for every plain single-key binding in the list.

Component form, so the hook can be mounted from inside the UI provider.

toRichText

function

Convert a plain string into a rich-text document.

traceCross

function

An `×` centred on a point, as the snap layer marks an aligned edge.

Trace a polyline.

Trace a rectangle with rounded corners.

Trace a scribble as a *tapered* ribbon rather than a stroked line.

A copy of a flat path with `mat` applied to every point.

Trim whitespace at the end of a label (kept inside the run, e.g.

Shorten a string with an ellipsis, on a grapheme boundary.

UiTooltip

function

The single tooltip for the whole UI.

Undo and redo, as one group.

Ungroup the selection.

Unlock every locked shape on the page.

unwrapLabel

function

The plain text of a label that may carry markup.

Recompute the target state from the current pointer position, publish it, and return it.

useA11y

function

The announcer.

Binds the action list's shortcuts for as long as the calling component is mounted.

The action list published by the nearest {@link TldrawUiActionsProvider}, if any.

Whether an action can run right now, and whether it is on.

Position an element beside `anchor` once it has been measured.

Whether any menu at all is open.

The languages this editor can actually be shown in.

The actions that really answer to a key right now, in action-list order.

The tools that really answer to a key right now, in tool-list order.

The current breakpoint.

Whether an action that edits the selection can run: the editor is writable and at least one selected shape is unlocked.

useCanRedo

function

Whether there is anything to redo.

useCanUndo

function

Whether there is anything to undo.

A coarse status for the collaboration chrome.

useCopyAs

function

"Copy as PNG/SVG/JSON", with the toast the menu item is expected to raise.

The resolved dictionary.

Everything a menu item's `onSelect` normally reaches for, in one object.

useDialogs

function

The dialog stack.

useDirection

function

The writing direction of the current locale; `"ltr"` outside a provider.

Close on Escape or on a pointer press outside both the layer and its anchor.

The handle for a label that stores a plain string.

The handle for a label that stores a rich-text document.

useExportAs

function

"Export as PNG/SVG", with the same error toast.

Drop and paste support for the canvas container: files, images, svg markup, urls and plain text are routed to `editor.putExternalContent`.

Whether the current page has any locked shapes to unlock.

Resolve a chrome slot the way the surrounding chrome resolves it.

Resolve an image or video asset to a URL that can be put in a `src`.

Whether the editor is in dark mode right now.

Whether the grid is on.

Default keyboard shortcuts: {@link KEYBOARD_SHORTCUTS}, plus tool switching.

A value kept in `localStorage`, as React state.

The resolved dictionary, or `null` outside a provider.

Cut, copy and paste for the menus and the action list.

Whether a menu is open, tracked on the editor's instance state.

Roving focus inside a menu: Up/Down move, Home/End jump, and focus lands on the first item when the menu opens.

The native `copy`, `cut` and `paste` listeners on the container.

usePeerIds

function

The ids of everyone else on this page.

usePeers

function

Everyone else on this page.

Whether the *operating system* asks for reduced motion.

usePresence

function

One person's presence record, or `null` when they have left.

useReadonly

function

Whether the editor refuses document edits.

Whether motion is reduced right now: the user's `animationSpeed` preference, or — while they have expressed none — the operating system's.

The styles the style panel should offer, and their shared values.

Announce the selection whenever it changes.

Whether to show collaboration chrome at all.

The style panel's context.

The UI chrome map.

The menu context an item is in.

The current orientation, plus the two keys that move focus along it.

useToasts

function

The toast list.

Binds the tool list's shortcuts for as long as the calling component is mounted.

The tool list published by the nearest {@link TldrawUiToolsProvider}, if any.

Suppress tooltips for as long as the caller says.

Look a string id up.

useUiEvents

function

Report a UI event.

Whether the editor is in a state where the UI lists are worth reading at all — an editor that has been disposed still renders, but nothing it lists can be acted on.

How many of the selected shapes can actually be changed.

ViewSubmenu

function

The view submenu: zoom and grid.

withCamera

function

Run `draw` with the camera installed, so everything inside is in **page** coordinates.

Split `text` into rendered lines: hard breaks on `\n`, soft wraps at `maxWidth` when given.

Break `spec.text` into the lines the label renders as: hard newlines always, plus greedy word wrapping at `maxWidth` (breaking inside a word only when a single word does not fit), mirroring `overflow-wrap: break-word`.

Break a spec's label into the lines the raster draws, keeping each run's formatting.

Zoom to fit, or rotate — whichever the pointer device suggests.

Reset the camera to 100%.

Fit the whole page in the viewport.

Fit the selection in the viewport.

A {@link Placement} with the room the layer has to fit in.

ArcBody

interface

The paint a bound-terminal marker is drawn with.

How the anchor dot is drawn.

Props of an `arrow` binding.

ArrowBindings

interface

The paint an arrow hint is drawn with.

How the "will bind" outline is drawn.

`ArrowShapeUtil`'s settings; see {@link ShapeUtil.configure}.

What an arrow paints with.

One of the four side handles the hint overlay draws on a target.

The shape an arrow terminal is currently over, and everything derived from that.

One entry in the aspect-ratio picker.

Constructor form, matching what `<Mocanvas assetUtils={…}>` accepts.

What every asset util can be configured with; a subclass adds its own.

AtPoint

interface

Where content should land, when it says.

What every rendering of a path needs, whatever its style.

BookmarkCard

interface

Everything the card draws, with each field falling back to something renderable.

Where each part of the card sits, in shape-local space.

BookmarkRect

interface

A rectangle in shape-local space.

`BookmarkShapeUtil`'s settings; see {@link ShapeUtil.configure}.

BoxSize

interface

A `w`/`h` pair in page units.

The bars that appear over a selected image or video.

The paint a brush is drawn with, resolved against the live theme.

Everything about a brush that is not a colour.

CameraLike

interface

A camera, as {@link Editor.getCamera} returns it.

Shared configuration for the collaborator painters.

CopyAsOptions

interface

Limits {@link getCropBox} respects.

CubicSegment

interface

Flags an app adds of its own.

An embed definition supplied by the app.

Draw the path as evenly spaced dashes or dots.

DebugFlagDef

interface

One flag: a name, a default, and the signal holding its current value.

Settings for the built-in services, keyed by service id.

The formatting bar over a text shape that is being edited.

The inputs {@link PathBuilder.toDrawD} needs to reproduce one hand-drawn pass.

Draw the path with a hand-drawn wobble.

DrawPoint

interface

DrawSegment

interface

`DrawShapeUtil`'s settings; see {@link ShapeUtil.configure}.

What a draw shape paints with.

Everything a label component needs, from either hook.

ElbowArrowBox

interface

A box the router works with, in both the sizes it needs: the shape's own bounds, and those bounds grown by the clearance an arrow keeps from them.

A box's four sides, keyed by side.

The two ends and the space they share.

One side of a box, as the router sees it.

{@link ElbowArrowInfoWithoutRoute} plus the route that was picked.

Everything the router derived, before it picked a route.

The handle that slides an elbow's middle leg.

How much room an elbow arrow gives itself.

A closed span on one axis, in page units.

A routed elbow: the polyline, and everything a caller needs to describe it.

One end of an elbow arrow: the box it attaches to, plus how it may attach.

ElbowBody

interface

A body made of straight runs: the elbow arrow's axis-aligned route with its corners already rounded.

ElbowRoute

interface

Which axis an elbow arrow leaves a terminal on, when that terminal is bound.

One embeddable service: the exact hosts it is recognised by, and how one of its page urls becomes an embeddable one.

EmbedInfo

interface

What {@link getEmbedInfo} resolved a url to.

EmbedMatch

interface

A url that matched the permit list.

What an embed shape paints with.

Options for {@link defaultHandleExternalUrlContent}.

A toast surface, as much of one as this module needs.

`FrameShapeUtil`'s settings; see {@link ShapeUtil.configure}.

What a frame paints with.

GeoFlip

interface

Which axes a silhouette is mirrored about, inside its own `w × h` box.

Options {@link GeoTypeDefinition.getPath} is given beyond the box.

`GeoShapeUtil`'s settings.

GeoShapeProps

interface

What a geo shape paints with.

One geo silhouette.

Google Maps needs a key to embed anything beyond a basic map, so it is the one built-in with settings worth naming.

`HighlightShapeUtil`'s settings; see {@link ShapeUtil.configure}.

What a highlight paints with.

IconProps

interface

ImageCrop

interface

Normalized crop window: both corners in [0, 1] of the source image.

Pixel dimensions of an image.

`ImageShapeUtil`'s settings; see {@link ShapeUtil.configure}.

What an image shape paints with.

ImageSize

interface

LinePoint

interface

`LineShapeUtil`'s settings; see {@link ShapeUtil.configure}.

What a line paints with.

MocanvasProps

interface

Do not stroke the path at all; a fill (when the run asked for one) still paints.

`NoteShapeUtil`'s settings; see {@link ShapeUtil.configure}.

What a note paints with, once its style props have been resolved.

What {@link onDragFromToolbarToCreateShape} needs from the toolbar button.

OverlayBox

interface

A page-space rectangle.

The page picker.

An SVG-style elliptical arc to `(x, y)`.

Per-command settings shared by every command that draws a line.

Settings for a command that *starts* a run — `moveTo`, and the two static builders.

Which part of a path {@link PathBuilder.toD} should write.

Closes the run in progress, joining its end back to its `moveTo`.

A cubic bézier to `(x, y)` through two control points.

A straight segment to `(x, y)`.

A `moveTo`: lifts the pen and starts a new run.

PathRun

interface

The half-open command range of one run, and whether that run is filled.

Placement

interface

Shape labels, in the three forms a shape needs them.

PopoverProps

interface

RichText

interface

A rich-text document — the value stored in a shape's `richText` prop.

RichTextBlock

interface

A block of the document flattened to styled runs.

A mounted rich-text editor.

What mocanvas hands a rich-text editor when the user starts editing a label.

The minimum an entry of the extension list has to be.

The font a rich-text node is drawn in, carried down the document tree.

RichTextMark

interface

A formatting mark on a text node: `{ type: "bold" }`, `{ type: "link", attrs: { href } }`.

A formatting mark mocanvas knows how to render, measure and export.

RichTextNode

interface

One node of a rich-text document.

A node type mocanvas knows how to render, measure and export.

RichTextRun

interface

A run of text sharing one style — the unit the canvas raster and SVG export draw.

The typographic effect of the marks on one run of text.

The paint a scribble falls back to when its record does not name a colour.

How scribbles are drawn.

The paint the selection box and its handles are drawn with.

Selection chrome geometry, in CSS pixels.

The paint a shape handle is drawn with.

Handle geometry, all in CSS pixels so handles are one size at every zoom.

A shape util's options, including how it resolves its style props into the concrete values it paints with.

ShortcutRow

interface

One row: a label and the key that reaches it.

The paint a snap guide is drawn with.

How snap guides are drawn.

Draw the path as one continuous stroke.

StraightBody

interface

StrokeOptions

interface

Everything the stroke pipeline can be tuned by.

StrokePoint

interface

One resampled point of a stroke: where it is, how wide, and how far along.

How a stroke's start or end is shaped.

What every picker needs: the styles in play, and how to change one.

The style rows the panel renders, in order, grouped as the panel groups them.

One choice in a picker: the value, and how to draw it.

Export-wide settings a renderer may consult.

SvgTextBox

interface

SvgTransform

interface

Affine transform components as returned by `Editor.getShapePageTransform`.

TextAreaProps

interface

`TextShapeUtil`'s settings; see {@link ShapeUtil.configure}.

What a text shape paints with.

One rendered line of a rich-text raster: the styled runs it is made of, and their total width.

ThemeSource

interface

What a ramp can be read off: the editor, or anything else theme-shaped.

The `StarterKit` options an app may override.

A bowed arrow, resolved.

TLArcInfo

interface

A circular arc, in the form an SVG `A` command and a length query both need.

The anchor dot at an arrow terminal that is *already* bound.

The hint drawn on a shape an arrow terminal is about to bind to.

TLArrowPoint

interface

One end of an arrow: where the handle sits, where the line stops, and what is drawn there.

The selection brush dragged by the select tool.

Another person's selection brush.

Another person's pointer.

The marker that says a collaborator is off screen, and which way to look.

What every collaborator overlay carries: who it belongs to, and their colour.

One of another person's live scribbles.

An outline around a shape another person has selected.

{@link TLExternalContentProps} plus the two UI contexts a handler needs to talk to the user.

TLDefaultFont

interface

The four faces of one family: upright and italic, each normal and bold.

The built-in families, keyed by the `font-family` a shape's `font` prop resolves to.

A snapshot, rendered as a static picture.

Which way a container of controls runs.

TldrawUiProps

interface

The whole chrome, laid out.

The elbow member of the arrow-info union — what `getArrowInfo` returns for an arrow whose `kind` is `"elbow"`, alongside the arc and straight members.

The file limits an app configures on the component.

One binding this hook installs.

TLLanguage

interface

A language mocanvas knows how to name and lay out.

One live scribble — a laser trail, an eraser stroke.

The selection box and one of its resize/rotate handles.

One of a shape's own handles — an arrow terminal, a line vertex.

One snap guide: the aligned edge or centre, plus the points it aligned.

A straight arrow, resolved.

TLTypeFace

interface

A font file to load, as {@link preloadFont} takes it.

TLUiA11y

interface

One thing to say.

What {@link useA11y} hands back.

What both clipboard hooks hand back.

The UI half of the chrome override map.

One provider that mounts every UI context in the right order.

TLUiDialog

interface

One entry on the dialog stack.

What a dialog component is rendered with.

TLUiEventData

interface

The common half of every reported event: where the user did it.

TLUiEventMap

interface

The events the default chrome reports, and what each one carries beyond the common `{ source }`.

TLUiGridProps

interface

TLUiIconProps

interface

The icon element the UI primitives use.

The text field the chrome uses: a page name, a link, a numeric style value.

TLUiKbdProps

interface

A keyboard shortcut, rendered.

How a layer learns about the layers opened from inside it.

The three layout boxes the chrome is assembled from.

The props each panel slot is rendered with.

The chrome's slider — opacity, and anything else an app puts in the style panel.

TLUiToast

interface

One message.

A button on a toast.

The toolbar primitive, and the buttons that go in it.

One locale's dictionary: string id to display text.

The brush dragged by the zoom tool.

ToolbarItem

interface

The default toolbar's contents, as data.

The toolbar's buttons, one exported component per tool.

TransformLike

interface

Affine transform components as returned by `Editor.getShapePageTransform`.

Everything {@link updateArrowTargetState} needs to work out the answer.

`VideoShapeUtil`'s settings; see {@link ShapeUtil.configure}.

What a video shape paints with: the placeholder frame and the play glyph drawn over it.

VisitedNode

interface

The subset of a ProseMirror node this visitor reads.

How urgently an announcement interrupts.

How loud a message is.

How an arrow's terminal is drawn.

One aspect-ratio option's value.

What a bookmark card paints with.

Either the shape that was created, or why it was not.

A boolean debug flag.

The services recognised out of the box, by their stable ids.

Everything {@link registerDefaultExternalContentHandlers} accepts.

A name with its own artwork.

Which side of a box an elbow arrow attaches to.

Which coordinate a leg varies: `"x"` for a horizontal leg, `"y"` for a vertical one.

Per-service settings, keyed by {@link EmbedDefinition.type}.

Settings for one embeddable service, as the app supplies them: an api key, a player option, a locale.

One of {@link EMBED_SHAPE_PERMISSION_NAMES}.

How other shapes snap to this silhouette.

A group's props: none.

An alias for a drawn icon.

Any name the set answers to, drawn or aliased.

Resolves an image's pixel size from its source; injectable so tests can run without a DOM.

The parse result plus whatever the load could not read cleanly.

Either the records a file held, or why it could not be read.

One entry of a {@link PathBuilder}'s command list.

Every way a path can be rendered, as a discriminated union on `style`.

How a dashed run starts or ends.

Props

type

{@link ArrowShapeProps} with the *derived* label filled in as well.

{@link GeoShapeProps} with the *derived* label filled in as well.

{@link NoteShapeProps} with the *derived* label filled in as well.

{@link TextShapeProps} with the *derived* label filled in as well.

Creates a rich-text editing surface — a TipTap editor, in practice.

Anything a label may be given: a rich-text document, a plain string, or nothing.

Renders one shape to SVG markup in shape-local coordinates.

Side

type

Where a floating layer sits: over, under, or beside its anchor.

A resolved arrow, discriminated by how its body is routed.

The formats "copy as" can write.

The documented name for the props `<Mocanvas />` takes.

A parsed `.tldr` file: the schema it was written under, and its records.

Why a file could not be read.

What resolving a url against the permit list produced, or `undefined` when the url is not one that gets embedded.

Which features an embedded page is granted: present and `true` grants, absent or `false` withholds.

The `@tldraw/tlschema` spelling of {@link GroupShapeProps}.

The `@tldraw/tlschema` spelling of {@link HighlightShape}.

The `@tldraw/tlschema` spelling of {@link HighlightShapeProps}.

The sections the shortcuts dialog groups its rows under.

The `@tldraw/tlschema` spelling of {@link LinePoint}.

What `onMount` is: called once with the editor as soon as it exists, and on nothing else.

One resolved indicator: the paths to stroke, the page transform to stroke them under, and the paint to use.

A partial override of the self-hosted asset urls, as an app supplies one.

One of the {@link PORTRAIT_BREAKPOINT} values.

How a button reads: its size, its emphasis, and whether it is a menu row.

The UI chrome map after defaults and overrides: every slot present.

What {@link useDefaultHelpers} hands back.

The value {@link useUiEvents} returns — the handler an app passed as `onUiEvent`, or a no-op.

What a host supplies as `onUiEvent`.

A ready-made element used in place of a named icon.

A built-in icon name, or any string.

Where a menu item is being rendered.

Read for its side effect on the type checker only; keeps `useEditor` imported.

Read for its side effect on the type checker only.

Read for its side effect on the type checker only.

The value {@link useCurrentTranslation} returns: the active locale's strings.

A UI string id.

Every built-in face as a flat list.

ARROW_KINDS

constant

Routing kinds an arrow can have.

How far a bound arrow stops short of the shape it points at, as a multiple of its stroke width.

The arrow binding's props migrations.

`ArrowBindingUtil`'s props.

Arrow pointing down.

Arrow pointing left.

Arrow pointing right.

The arrow shape's props migrations.

`ArrowShapeUtil`'s props.

Named versions of the arrow shape's props; see {@link arrowShapeMigrations}.

The arrow tool.

Arrow pointing up.

The aspect ratios the image bar offers.

The width-over-height each named ratio means.

The image / media placer.

Average glyph advance as a fraction of the font size.

The banner strip behind the asset's preview image (and its colour when there is none).

BOOKMARK_GAP

constant

Body left under the banner even on a short card, so the text never disappears.

The toast id used when a link could not be unfurled.

The bookmark shape's props migrations; see the module comment.

`BookmarkShapeUtil`'s props.

Check box.

Cloud.

Light, dark, or follow the system.

The commenting tool.

Turn an embed into a bookmark.

Turn a bookmark into an embed.

What every flag resolves to before anything has been changed.

debugFlags

constant

The flags mocanvas itself reads.

DebugStats

constant

Compact frame-statistics chip.

Whether the frame-statistics chip is visible.

A small hint-coloured dot with a paper-coloured ring.

The theme's `hint` colour, not `selectStroke`.

The default brush geometry and paint, shared by both brushes.

The dials every collaborator overlay has.

The defaults, in page units.

The services recognised out of the box.

The box a click places a built-in silhouette at.

The built-in table: one entry per {@link GeoShapeKind}.

The largest file the drop and paste paths will turn into an asset, in bytes.

The default scribble paint: taper on, colours from the theme.

The v5 defaults: a 9px square handle, a 5.5px rotate dot, 1.5px strokes.

Solid handles at 6px, virtual ones at 4px and half-transparent.

Thin lines and small crosses, in the theme's hint colour.

Image types every browser that runs the canvas can decode.

Video types every browser that runs the canvas can play.

The default set of toolbar buttons, in order.

The built-in asset utils, in registration order.

The built-in binding utils, in the order they are registered.

The chrome mocanvas renders when an app overrides nothing.

The frame-statistics chip.

The editor's default asset urls: none.

The banner shown while the camera is following someone.

defaultFonts

constant

The built-in families, as {@link TLDefaultFonts}.

The built-in geo forms, keyed by their `geo` prop value.

The bar over a selected image.

A scaled-down view of the page, with the viewport drawn on it.

Pass to `Editor`/`<Mocanvas>` as `overlayUtils`, or spread it to add one:

The page menu.

The people menu.

The collaborator list, plus the local person's own name and colour.

The rich-text bar.

Fallback renderer applied to shape types without a registry entry.

The tools that *place a shape*: one entry per built-in shape type that has a tool of its own.

The top-right panel: who is here.

The docked style panel.

defaultTools

constant

Every built-in tool: the canvas tools plus {@link defaultShapeTools}.

The local person's name and cursor colour.

The bar over a selected video.

Diamond.

The draw shape's props migrations; see the module comment.

`DrawShapeUtil`'s props.

The freehand draw tool.

Edit the selected shape's link.

EditSubmenu

constant

Alias of {@link EditMenuSubmenu}, under its other documented name.

The four sides, in clockwise order from the top.

Corner radius as a multiple of the stroke width.

Ellipse.

EMBED_HEIGHT

constant

EMBED_RADIUS

constant

The sandbox an embedded page runs in.

The powerful features an embedded page may be granted, as the iframe `allow` attribute names them.

EMBED_WIDTH

constant

The permit list `getEmbedDefinition` consults.

The embed shape's props migrations; see the module comment.

The permissions an embedded page is granted by default, as iframe permissions-policy features.

`EmbedShapeUtil`'s props.

The eraser.

The ramp a caller that has no editor resolves against: the built-in theme's light half.

featureFlags

constant

Longer-lived switches for work in progress.

Shrink a frame to fit what is inside it.

FRAME_FILL

constant

A frame's body.

The frame's name, drawn in the strip above it.

Gap between the bottom of that strip and the frame's top edge.

Box the frame name is laid out in: the strip above the frame, minus the gap.

Height of the strip above the frame that the name is laid out in.

FRAME_STROKE

constant

A frame's border.

Width of that border, in page units.

The frame shape's props migrations; see the module comment.

`FrameShapeUtil`'s props.

The frame tool.

GEO_BOX

constant

Longest side of the box a geo outline is fitted into, centred in the grid.

The box a click (rather than a drag) places a geo shape at.

`d` attribute for each geo kind, fitted to its icon box.

The geo shape's props migrations.

`GeoShapeUtil`'s props; see the module comment.

Named versions of the geo shape's props, for {@link geoShapeMigrations}.

A geo-kind button: selects the geo tool *and* the kind.

Group, or ungroup — whichever applies.

The group shape's props migrations.

`GroupShapeUtil`'s props: a group is a container and carries none.

The hand (pan) tool.

Heart.

Fraction of the box height spanned by the hexagon's two vertical sides.

Hexagon.

How see-through a highlight is.

How wide a highlight is drawn, per `size`, at `scale: 1`.

The highlight shape's props migrations; see the module comment.

`HighlightShapeUtil`'s props: a draw stroke with no fill and no dash.

The highlighter.

ICON_ALIASES

constant

Second spellings for icons that already exist.

ICON_GRID

constant

Side of the drawing grid.

ICON_NAMES

constant

All icon names, aliases included, sorted — handy for tests and galleries.

ICONS

constant

Every icon that has artwork of its own, keyed by name.

iconTypes

constant

Every icon name mocanvas ships, sorted.

The image shape's props migrations; see the module comment.

`ImageShapeUtil`'s props.

Which pointer devices draw.

Every shortcut the editor binds, as data.

Makes Shift+Enter insert a line break instead of splitting the block.

LanguageMenu

constant

Pick the UI locale — when there is more than one to pick from.

LANGUAGES

constant

The languages offered in the language menu.

The laser pointer.

LINE_HEIGHT

constant

Cheap text metrics used until real measurement lands (phase 2 text layout).

The line shape's props migrations; see the module comment.

`LineShapeUtil`'s props.

The line tool.

Default size loader: `createImageBitmap` when available, else an `Image` element.

Hard cap on either canvas dimension, so a huge label cannot blow up the GPU.

The style panel as a popover, for narrow layouts.

The MIME-ish tag mocanvas content is written under.

MOD_KEY

constant

Accelerator prefix for tooltips: `⌘` on Apple platforms, `Ctrl+` elsewhere.

Geo kinds that live behind the "more shapes" popover.

Move the selection to another page.

A note body is not flat.

NOTE_PADDING

constant

The soft shadow that falls below a note.

A note's shadow falls almost entirely *below* it.

NOTE_SIZE

constant

The note shape's props migrations.

`NoteShapeUtil`'s props.

Named versions of the note shape's props; see {@link noteShapeMigrations}.

The sticky-note tool.

Oval.

The breakpoints, smallest first.

Geo kinds with a toolbar button of their own.

PrintItem

constant

Print the drawing — the selection if there is one, otherwise the page.

Rectangle.

Delete a frame but keep its children.

Rhombus.

The CSS a rich-text label lays out under, in both the measuring probe and the DOM overlay.

The formatting marks a mocanvas label understands out of the box.

The block and inline node types a mocanvas label understands out of the box.

A rich-text document, as a shape's `richText` prop holds it.

Base languages written right to left.

The select tool.

Registry of per-type renderers.

Inner radius of the five-pointed star, as a fraction of the outer radius.

Star.

StylePanel

constant

Style controls for the selection (or, with nothing selected, for the next shape the active drawing tool creates).

Publishes the style panel's context.

Shape opacity.

Minimum width of an auto-sized text shape so an empty one still shows a caret area.

The text shape's props migrations; see the module comment.

`TextShapeUtil`'s props.

The text tool.

The default extension set the canvas text editor uses.

The extension a saved document is written under, including the dot.

One toolbar button, driven by the tool list.

Let a text shape size itself to its content again.

Announce more than the minimum to a screen reader.

Invert the scroll direction of zooming.

The padlock at the end of the toolbar: keep the current tool after drawing.

Toolbar

constant

The default tool bar: the grouped tools, plus a popover holding the geo kinds that have no button of their own.

Toolbar entries, grouped; groups are separated by a divider.

Trapezoid.

Triangle.

The permissions applied to an embed whose url matched no definition.

useMsg

constant

Alias of {@link useTranslation}, spelled as the value it returns.

VIDEO_HEIGHT

constant

The play triangle drawn on the placeholder (and in an SVG export).

Seeking to within this many seconds of the stored time is treated as already there.

VIDEO_WIDTH

constant

The video shape's props migrations; see the module comment.

`VideoShapeUtil`'s props.

X box.

ZoomBar

constant

Zoom controls and undo/redo.

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.