Crosshair Highlighting

Plugins Info

Crosshair highlighting marks the row and the column of the selected cell, which makes the active cell easy to identify.

Plugin mode

Installation

Shell
pnpm add @univerjs/sheets-crosshair-highlight

Usage

TypeScript
import { LocaleType, mergeLocales, Univer } from '@univerjs/core'import { UniverSheetsCrosshairHighlightPlugin } from '@univerjs/sheets-crosshair-highlight'import SheetsCrosshairHighlightEnUS from '@univerjs/sheets-crosshair-highlight/locale/en-US'import '@univerjs/sheets-crosshair-highlight/lib/index.css'import '@univerjs/sheets-crosshair-highlight/facade'const univer = new Univer({  locale: LocaleType.EN_US,  locales: {    [LocaleType.EN_US]: mergeLocales(      SheetsCrosshairHighlightEnUS,     ),  },})univer.registerPlugin(UniverSheetsCrosshairHighlightPlugin)

Mobile support

Configure the mobile editor first. In the plugin-mode setup on this page, replace the desktop registrations below with the mobile exports from the same packages, and complete 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/sheets-crosshair-highlightUniverSheetsCrosshairHighlightPluginUniverSheetsCrosshairHighlightMobileUIPlugin

Preset mode

Crosshair highlighting does not provide a preset of its own, but its plugin can be added alongside a preset.

Shell
pnpm add @univerjs/sheets-crosshair-highlight

Usage

TypeScript
import UniverPresetSheetsCoreEnUS from '@univerjs/preset-sheets-core/locales/en-US'import { UniverSheetsCrosshairHighlightPlugin } from '@univerjs/sheets-crosshair-highlight'import '@univerjs/sheets-crosshair-highlight/facade'import '@univerjs/sheets-crosshair-highlight/lib/index.css'const { univerAPI } = createUniver({  locale: LocaleType.EN_US,  locales: {    [LocaleType.EN_US]: mergeLocales(      UniverPresetSheetsCoreEnUS,      SheetsCrosshairHighlightEnUS,     ),  },  presets: [    UniverSheetsCorePreset(),  ],  plugins: [    UniverSheetsCrosshairHighlightPlugin,   ],})

Facade API

Complete Facade API type definitions are in FacadeAPI.

Importing

Plugin mode note

The Facade package is imported manually only in plugin mode. Preset mode already includes it, so no additional import is required.

TypeScript
import '@univerjs/sheets-crosshair-highlight/facade'

Toggle crosshair highlight

TypeScript
univerAPI.setCrosshairHighlightEnabled(true)univerAPI.setCrosshairHighlightEnabled(false)

Get crosshair highlight enabled status

TypeScript
univerAPI.getCrosshairHighlightEnabled()

Event listeners

Complete event type definitions are in Events.

CrosshairHighlightEnabledChanged fires when crosshair highlighting is enabled or disabled.

TypeScript
const disposable = univerAPI.addEvent(univerAPI.Event.CrosshairHighlightEnabledChanged, (params) => {  const { enabled, workbook, worksheet } = params})// Remove the event listener using `disposable.dispose()`

How is this guide?

© 2026 DreamNum Co., Ltd.