Skip to content

Text, regions and anatomy ​

Text belongs to an element's canonical story. A region is a named place in that story with resolved bounds, text rules and layout behavior. It is not a separate floating editor laid on top of the shape.

Built-in regions ​

ElementDefault text arrangement
Rectangle, ellipse, polygon and drawingOne body region
CardSingle-line title and multiline body
CommentBody inside the folded paper
FrameTitle above the boundary
TableA body-text region for each cell
Standalone textOne body region, no shape surface
ConnectorOne or more label stories
Image, path and groupNo built-in text region

Double-click cell text to select a word. Double-click empty space inside a cell to place a caret in that cell. A frame's title is edited from its title region; its body remains available for selecting contained elements.

Multiple regions ​

A custom definition places several ShapeText parts in its body, each with a unique slot identity, initial text, text role, single-line behavior, padding, vertical alignment and placeholder. Rows, columns, stacks, padding, surfaces and ShapeTable arrange them. The body compiles into the resolved geometry used by painting, hit testing and editing.

Regions can occupy padded space, fixed bands in a row or column, or a band outside the frame (ShapeOutside), as a frame's title does. The standard Card demonstrates a title and body; a class can use a title plus a single-column table for members. Add regions in a registered definition, rather than inventing new canvas elements or duplicating text-editing logic.

See shape anatomy and custom shapes for the declaration APIs.

Content and size ​

ShapeTextSizing.fixed keeps the authored shape geometry authoritative. ShapeTextSizing.growHeight treats authored height as a minimum and lets content increase the resolved height downward. Cards, comments and tables opt into height growth. Text is never clipped to the shape's outline; each region clips to its own bounds.

Standalone text also has automatic-width and fixed-width sizing modes. Changing width affects wrapping; text layout determines the required height. Region bounds, caret placement, selection and export consume the same resolved text layout.

Embedded tables ​

ShapeTable('members', rows: 2, columns: 1) declares a table in the space allocated by its parent part. It fills that region and participates in content sizing. A table's cells are nested text elements. A cell may contain styled body paragraphs, but cannot contain another table, a heading or a list. See Tables.