Tinacms Developer Docs
Fields

Rich Text Field

A WYSIWYG editor for markdown content with optional MDX support

The rich-text field stores markdown content with a WYSIWYG editor. Supports text formatting, links, images, tables, and custom embedded components (with MDX).

Usage

{
  type: 'rich-text',
  name: 'body',
  label: 'Body',
  isBody: true,
}

Options

PropertyTypeDescription
type'rich-text'Required.
namestringField identifier.
labelstringDisplay label in the editor.
isBodybooleanWhen true, maps to the document body.
templatesTemplate[]Enable MDX with custom components.
toolbarOverridestring[]Customize toolbar buttons.

Type Signature

interface RichTextField {
  type: 'rich-text'
  name: string
  label?: string
  isBody?: boolean
  templates?: Template[]
  toolbarOverride?: Array<
    'heading' | 'bold' | 'italic' | 'link' | 'image' |
    'quote' | 'ul' | 'ol' | 'code' | 'codeBlock' | 'table'
  >
}

Examples

Toolbar Override

Limit the toolbar to specific formatting options:

{
  type: 'rich-text',
  name: 'body',
  label: 'Body',
  isBody: true,
  toolbarOverride: ['heading', 'bold', 'italic', 'link'],
}

With MDX Components

Embed custom React components in the content:

{
  type: 'rich-text',
  name: 'body',
  label: 'Body',
  isBody: true,
  templates: [
    {
      name: 'Callout',
      label: 'Callout',
      fields: [
        { type: 'string', name: 'type', options: ['info', 'warning'] },
        { type: 'string', name: 'text', ui: { component: 'textarea' } },
      ],
    },
  ],
}

Notes

Reserved Name

Don't use "children" as a field name — it conflicts with internal APIs.

Tables only support single-line cells (markdown limitation).

On this page