# @univerjs/sheets

> Language fallback: requested `es-ES`; content is `en-US`.

- Human documentation: [https://docs.univer.ai/es-ES/reference/packages/plugins/univerjs/sheets](https://docs.univer.ai/es-ES/reference/packages/plugins/univerjs/sheets)

- Agent Markdown: [https://docs.univer.ai/es-ES/reference/packages/plugins/univerjs/sheets.md](https://docs.univer.ai/es-ES/reference/packages/plugins/univerjs/sheets.md)

- Requested language: `es-ES`

- Content language: `en-US`

- Documentation version: `1.2.0`

- Source: [packages/plugins/univerjs/sheets.mdx](https://github.com/dream-num/documentation/blob/dev/content/reference/packages/plugins/univerjs/sheets.mdx)

---

Core spreadsheet model and business logic for Univer Sheets.

```typescript
// [!code word:UniverSheetsPlugin]
import { UniverSheetsPlugin } from '@univerjs/sheets'

univer.registerPlugin(UniverSheetsPlugin, {})
```

## Entry Points

* Facade: `@univerjs/sheets/facade`
* Locale: `@univerjs/sheets/locale/*`

## Worksheet copy interceptors

`CopySheetCommand` passes `ICopySheetCommandInterceptorParams` to `SheetInterceptorService.interceptCommand()`. Alongside `unitId` and `subUnitId`, it provides the new worksheet's `targetSubUnitId`, its resolved `targetSubUnitName`, and a shared `copyContext: Map<string, unknown>` for that copy operation. Use the supplied name when copying resources that store worksheet references; the destination worksheet has not yet been inserted when the interceptor runs.

Return resource changes as `redos` and `undos` so they participate in the worksheet copy's undo history. The Pro pivot plugin uses this path to [copy pivot tables with their worksheet](https://docs.univer.ai/es-ES/guides/sheets/features/pivot-table.md#copy-with-worksheet).

## IUniverSheetsConfig

```ts
import type { DependencyOverride } from '@univerjs/core'

export interface IUniverSheetsConfig {
  notExecuteFormula?: boolean
  override?: DependencyOverride
  /**
   * Only register the mutations related to the formula calculation. Especially useful for the
   * web worker environment or server-side-calculation.
   */
  onlyRegisterFormulaRelatedMutations?: true
  /**
   * If the row style and column style be set both, and the row style should precede the column style or not.
   */
  isRowStylePrecedeColumnStyle?: boolean

  /**
   * default false, auto height works for merged cells
   */
  autoHeightForMergedCells?: boolean

  /**
   * Extra spacing in pixels between lines of cell text, including rich text and editors.
   * Set at initialization for every workbook in this Univer instance.
   * Must be finite and non-negative. Defaults to 0; existing row heights are unchanged.
   */
  textLineGap?: number

  /**
   * Whether synchronize the frozen state to other users in real-time collaboration.
   * @default true
   */
  freezeSync?: boolean

  /**
   * Configuration for large sheet operations.
   * When a sheet has more cells than the threshold:
   * - Copy sheet: the mutation will be split into multiple batches
   * - Remove sheet: undo/redo will not be supported
   */
  largeSheetOperation?: ILargeSheetOperationConfig
}
```

See [cell text line spacing](https://docs.univer.ai/es-ES/guides/sheets/features/core/default-style.md#text-line-gap) for an interactive illustration and plugin/preset examples.

## ILargeSheetOperationConfig

```ts
export interface ILargeSheetOperationConfig {
  /**
   * The minimum number of cells that defines a "large sheet".
   * When a sheet has more cells than this threshold:
   * - Copy sheet: the mutation will be split into multiple batches
   * - Remove sheet: undo/redo will not be supported
   * @default 6000
   */
  largeSheetCellCountThreshold?: number

  /**
   * The maximum number of cells per batch when splitting mutations for large sheets.
   * @default 3000
   */
  batchSize?: number
}
```
