Callout

Plugins Info

A callout separates a piece of information from the surrounding text. The icon and the colors are configurable, so a note, a warning, and a tip can each have a distinct appearance.

Introduction

In Univer Docs, callout blocks serve three purposes:

  • They draw attention to a note, a warning, or a tip.
  • They apply the icon and colors selected for the block, so its appearance matches the content.
  • They divide a document into sections that are visually separate and read independently.

Plugin mode

Installation

Shell
pnpm add @univerjs-pro/docs-callout @univerjs-pro/docs-callout-ui

Usage

TypeScript
import { UniverDocsCalloutPlugin } from '@univerjs-pro/docs-callout'import { UniverDocsCalloutUIPlugin } from '@univerjs-pro/docs-callout-ui'import DocsCalloutUIEnUS from '@univerjs-pro/docs-callout-ui/locale/en-US'import { LocaleType, mergeLocales, Univer } from '@univerjs/core'import '@univerjs-pro/docs-callout-ui/lib/index.css'const univer = new Univer({  locale: LocaleType.EN_US,  locales: {    [LocaleType.EN_US]: mergeLocales(      DocsCalloutUIEnUS,     ),  },})univer.registerPlugin(UniverDocsCalloutPlugin)univer.registerPlugin(UniverDocsCalloutUIPlugin)

If your application uses Univer under a commercial license, configure it as described in Using License in Client.

Mobile support

Configure the mobile editor first. In the plugin-mode setup on this page, replace the desktop registrations listed below with the mobile exports from the same packages, and make the replacement before opening a document. Keep the model plugins, styles, locales, and Facade imports, and do not register both variants.

PackageDesktop registrationMobile registration
@univerjs-pro/docs-callout-uiUniverDocsCalloutUIPluginUniverDocsCalloutMobileUIPlugin

Facade API

Import the facade before calling the API:

TypeScript
import '@univerjs-pro/docs-callout/facade'

Get all callouts

TypeScript
const doc = univerAPI.getActiveDocument()const callouts = doc?.getCallouts() ?? []

Get a callout by ID

TypeScript
const doc = univerAPI.getActiveDocument()const callout = doc?.getCallout('callout-block-id')

Insert a callout

TypeScript
const doc = univerAPI.getActiveDocument()const callout = doc?.insertCallout({  startOffset: 12,  endOffset: 35,  config: { icon: '💡' },})

Update callout config

TypeScript
const callout = univerAPI.getActiveDocument()?.getCallout('callout-block-id')callout?.updateConfig({ icon: '⚠️' })

Set callout appearance

TypeScript
const callout = univerAPI.getActiveDocument()?.getCallout('callout-block-id')callout?.setIcon('📝')callout?.setBackgroundColor('#FFF4E5')callout?.setBorder({ color: '#E6A23C', width: 2 })callout?.setTextColor('#5C3B00')

Appearance changes are applied through document commands, so undo, redo, and collaboration receive them. setTextColor() applies a color to all text in the callout; call resetTextColor() to remove that override and restore the text colors inherited from the document.

TypeScript
const callout = univerAPI.getActiveDocument()?.getCallout('callout-block-id')callout?.resetTextColor()

How is this guide?

© 2026 DreamNum Co., Ltd.