@mocanvas/mocanvas · interface
interface TextLabelPropsThis one ships without a description. The signature above is read from the package, and the guides cover the area it belongs to.
Methods · 1
onChange(text: string): voidCalled with the new text; at most once per animation frame while typing.
Properties · 18
align?: DefaultHorizontalAlignStyle@deprecated v5 renamed this to textAlign.
color: stringCSS color of the text.
font?: DefaultFontStyle@deprecated v5 renamed this to fontFamily.
fontFamily?: DefaultFontStyleThe label's font style token. Named font before v5; font is still
accepted and means the same thing.
fontSize: numberheight?: numberisEditing: booleanonChangeRichText?(value: RichText): voidCalled with the new rich-text document, at the same rate as onChange.
A shape whose store prop is richText passes this; without it the label
still edits, and only the plain text is written back.
padding?: numberPadding on every side of the text, in px (default 0).
placeholder?: stringShown in place of an empty label when not editing.
richText?: RichTextSourceThe label as a rich-text document, when the store holds one. A shape may
carry either props.text or props.richText; both render here.
shape: UnknownShapesingleLine?: booleanSingle-line labels commit on Enter and never contain newlines (frame names).
text: stringThe label as plain text. Ignored for rendering when TextLabelProps.richText is set; still the value the plain-text editing fallback starts from.
textAlign?: DefaultHorizontalAlignStyleHorizontal alignment. Named align before v5; align is still accepted.
verticalAlign: DefaultVerticalAlignStylewidth?: numberBox the label is laid out in, in shape-local px. Omit for an intrinsically sized label.
wrap: booleanSoft-wrap at width. When false the label only breaks at explicit newlines.
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.