TLRichText

See source code

Type representing rich text content in tldraw. Rich text follows a document-based structure with a root document containing an array of content blocks (paragraphs, text nodes, etc.). This enables formatted text with support for multiple paragraphs, styling, and other rich content.

type TLRichText = T.TypeOf<typeof richTextValidator>

Example

const richText: TLRichText = {
  type: 'doc',
  content: [
    {
      type: 'paragraph',
      content: [{ type: 'text', text: 'Hello world!' }],
    },
  ],
}
Prev
TLRecord
Next
TLSchema