Configuration Options
The default configuration of Umo Viewer. You can visit https://www.umodoc.com/en/demo?target=viewer to modify and preview some configurations online in real-time.
All Configuration Options
{
lang: 'zh-CN',
theme: 'light',
title: undefined,
content: undefined,
meta: [],
cdnUrl: 'https://unpkg.com/@umoteam/editor-external@latest',
showHeader: true,
showAside: false,
editable: false,
printable: true,
closeable: false,
shareUrl: undefined,
fitWidth: false,
needPassword: false,
}Configuration Details
lang
Description: Default language. Options: zh-CN, en-US.
Type: string
Default: zh-CN
Required: No
theme
Description: Default theme. Options: light, dark, auto.
Type: string
Default: light
Required: No
title
Description: Document title.
Type: string
Required: No
content
Description: The document content to be previewed. In Umo Editor, you can obtain the content to preview via the getVanillaHTML method.
Type: string
Default: undefined
Required: Yes
meta
Description: Document metadata, used to display additional document information. Each item contains label and content properties. Default is [].
Type: object[]
Default: []
Required: No
Example:
meta: [
{
label: 'Author',
content: 'Umo Team',
},
{
label: 'Description',
content:
'Umo Viewer is a PDF document viewer that also supports rich text preview.',
},
{
label: 'Created At',
content: '2025-09-01 00:00:00',
},
// ...
]cdnUrl
Description: CDN URL for third-party resources (e.g., ECharts charts). For details, see the cdnUrl configuration item in Umo Editor configuration options.
Type: string
Default: https://unpkg.com/@umoteam/editor-external@latest
Required: No
showHeader
Description: Whether to display the top navigation bar.
Type: boolean
Default: true
Required: No
showAside
Description: Whether to expand the left sidebar by default. The sidebar mainly displays document thumbnails, outlines, and metadata.
Type: boolean
Default: false
Required: No
editable
Description: Whether the document is editable. Default is false. If set to true, you must configure the onEdit event.
Type: boolean
Default: false
Required: No
printable
Description: Whether the document can be printed. Default is true.
Type: boolean
Default: true
Required: No
closeable
Description: Whether to display a close button. Default is false. If set to true, a close button will appear in the top navigation bar, and you must configure the onClose event.
Type: boolean
Default: false
Required: No
shareUrl
Description: Document sharing URL. Default is undefined. If not set, the share button will not be displayed.
Type: string
Default: undefined
Required: No
fitWidth
Description: Whether to automatically adjust the document width. Default is false.
Type: boolean
Default: false
Required: No
needPassword
Description: Whether a password is required to access the document. Default is false. If set to true, you must configure the onValidatePassword event.
Type: boolean
Default: false
Required: No