DocumentionmobileConfigurationDefault Configuration

Default Configuration

Compared with Umo Editor and Umo Editor Next, the mobile configuration is more focused on touch-first reading, switching between read and edit modes, the save state machine, and lightweight integration. It does not include all desktop appearance and toolbar configuration items.

Full Configuration

const defaultOptions = {
  editorKey: 'default',
  locale: 'zh-CN',
  theme: 'light',
  debug: false,
  dicts: {
    fonts: [...],
    colors: [...],
    lineHeights: [...],
    symbols: [...],
    emojis: [...],
    pageSizes: [...],
  },
  page: {
    layouts: ['web', 'page'],
    defaultMargin: {
      left: 3.18,
      right: 3.18,
      top: 2.54,
      bottom: 2.54,
    },
    defaultOrientation: 'portrait',
    defaultBackground: '#fff',
    showBreakMarks: true,
    showLineNumber: false,
    showBookmark: false,
    watermark: {
      type: 'compact',
      alpha: 0.2,
      fontColor: '#000',
      fontSize: 16,
      fontFamily: 'SimSun',
      fontWeight: 'normal',
      text: '',
    },
  },
  document: {
    title: '',
    content: '',
    placeholder: {
      en_US: 'Please enter the document content...',
      zh_CN: '请输入文档内容...',
    },
    structure: 'block+',
    enableSpellcheck: true,
    enableMarkdown: true,
    enableBubbleMenu: true,
    enableBlockMenu: true,
    enableNodeId: false,
    readOnly: false,
    autofocus: false,
    characterLimit: 0,
    typographyRules: {},
    editorProps: {},
    parseOptions: {
      preserveWhitespace: 'full',
    },
    autoSave: {
      enabled: true,
      interval: 300000,
    },
  },
  echarts: {
    mode: 1,
    renderImage: false,
    onCustomSettings() {
      return null
    },
  },
  templates: [],
  cdnUrl: 'https://unpkg.com/@umoteam/editor-external@latest',
  shareUrl: location.href || '',
  file: {
    allowedMimeTypes: [],
    maxSize: 1024 * 1024 * 100,
  },
  user: {},
  users: [],
  extensions: [],
  disableExtensions: [],
  translations: {
    en_US: {},
    zh_CN: {},
  },
  async onLeave({ leaveSteps = 1 } = {}) {
    window.history.go(-Math.max(1, Number(leaveSteps) || 1))
  },
  async onSave() {
    throw new Error('Key "onSave": Please set the save method')
  },
  async onRename() {
    throw new Error('Key "onRename": Please set the rename method')
  },
  async onFileUpload(file) {
    if (!file) {
      throw new Error('File not found')
    }
    throw new Error('Key "onFileUpload": Please set the upload method')
  },
  onFileDelete() {
    console.error('The file has been deleted...')
  },
}

Configuration Overview

Key Differences from Desktop

  • debug Mobile-Only: controls whether the built-in DevTools entry is available in the “More” panel.
  • onLeave Mobile-Only: handles mobile back navigation, page leaving, and navigation behavior after unsaved-change confirmation.
  • onRename Mobile-Only: handles document rename from the “More” panel.
  • page.layouts defaults to ['web', 'page'] Different on Mobile, which means mobile enters web layout by default; desktop usually prioritizes paged view.
  • file.preview Different on Mobile: mobile does not support third-party preview through URL templates.

Configuration Items Not Supported on Mobile

  • skin Not Supported
  • height Not Supported
  • fullscreenZIndex Not Supported
  • toolbar Not Supported
  • webPages Not Supported
  • diagrams Not Supported
⚠️

The mobile configuration documentation is intentionally focused on what is actually supported in the current mobile product. For desktop-only items, please refer to the desktop documentation instead of assuming the same support boundary on mobile.