# @atlaskit/editor-plugin-code-block

> Code block plugin for @atlaskit/editor-core

Latest version **35.0.2** (published 2026-11-18) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @atlaskit/editor-plugin-code-block
pnpm add @atlaskit/editor-plugin-code-block
yarn add @atlaskit/editor-plugin-code-block
bun add @atlaskit/editor-plugin-code-block
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 35.0.2 |
| Published | 2026-11-18 |
| First published | 2023-11-07 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 31 |
| Unpacked size | 667.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Atlassian Pty Ltd |
| Maintainers | atlassianartifactteam |

## Links

- npm: https://www.npmjs.com/package/@atlaskit/editor-plugin-code-block
- Repository: https://bitbucket.org/atlassian/atlassian-frontend-mirror
- Homepage: https://bitbucket.org/atlassian/atlassian-frontend-mirror#readme
- Issues: https://bitbucket.org/atlassian/atlassian-frontend-mirror/issues
- npm.io page: https://npm.io/package/@atlaskit/editor-plugin-code-block

## Dependencies (31)

- [@atlaskit/code](https://npm.io/package/@atlaskit/code.md) ^20.0.0
- [@atlaskit/flag](https://npm.io/package/@atlaskit/flag.md) ^19.0.0
- [@atlaskit/icon](https://npm.io/package/@atlaskit/icon.md) ^38.1.0
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.0.0
- [@compiled/react](https://npm.io/package/@compiled/react.md) ^1.0.2
- [@atlaskit/button](https://npm.io/package/@atlaskit/button.md) ^25.8.0
- [@atlaskit/select](https://npm.io/package/@atlaskit/select.md) ^23.2.0
- [@atlaskit/tokens](https://npm.io/package/@atlaskit/tokens.md) ^20.14.0
- [@atlaskit/adf-schema](https://npm.io/package/@atlaskit/adf-schema.md) ^57.7.0
- [@atlaskit/primitives](https://npm.io/package/@atlaskit/primitives.md) ^22.8.0
- [@atlaskit/react-select](https://npm.io/package/@atlaskit/react-select.md) ^4.12.0
- [@atlaskit/editor-toolbar](https://npm.io/package/@atlaskit/editor-toolbar.md) ^2.11.0
- [@atlaskit/editor-prosemirror](https://npm.io/package/@atlaskit/editor-prosemirror.md) ^9.0.0
- [@atlaskit/frontend-utilities](https://npm.io/package/@atlaskit/frontend-utilities.md) ^5.1.0
- [@atlaskit/tmp-editor-statsig](https://npm.io/package/@atlaskit/tmp-editor-statsig.md) ^266.0.0
- [@atlaskit/editor-shared-styles](https://npm.io/package/@atlaskit/editor-shared-styles.md) ^5.2.0
- [@atlaskit/editor-plugin-toolbar](https://npm.io/package/@atlaskit/editor-plugin-toolbar.md) ^30.0.0
- [@atlaskit/platform-feature-flags](https://npm.io/package/@atlaskit/platform-feature-flags.md) ^2.2.0
- [@atlaskit/editor-plugin-analytics](https://npm.io/package/@atlaskit/editor-plugin-analytics.md) ^33.0.0
- [@atlaskit/editor-plugin-selection](https://npm.io/package/@atlaskit/editor-plugin-selection.md) ^33.0.0
- [@atlaskit/editor-ui-control-model](https://npm.io/package/@atlaskit/editor-ui-control-model.md) ^3.0.0
- [@atlaskit/prosemirror-input-rules](https://npm.io/package/@atlaskit/prosemirror-input-rules.md) ^4.1.0
- [@atlaskit/editor-plugin-block-menu](https://npm.io/package/@atlaskit/editor-plugin-block-menu.md) ^32.0.0
- [@atlaskit/editor-plugin-composition](https://npm.io/package/@atlaskit/editor-plugin-composition.md) ^32.0.0
- [@atlaskit/editor-plugin-decorations](https://npm.io/package/@atlaskit/editor-plugin-decorations.md) ^33.0.0
- [@atlaskit/editor-plugin-interaction](https://npm.io/package/@atlaskit/editor-plugin-interaction.md) ^47.0.0
- [@atlaskit/editor-plugin-feature-flags](https://npm.io/package/@atlaskit/editor-plugin-feature-flags.md) ^32.0.0
- [@atlaskit/platform-feature-experiments](https://npm.io/package/@atlaskit/platform-feature-experiments.md) ^0.3.0
- [@atlaskit/editor-plugin-editor-disabled](https://npm.io/package/@atlaskit/editor-plugin-editor-disabled.md) ^33.0.0
- [@atlaskit/editor-plugin-editor-viewmode](https://npm.io/package/@atlaskit/editor-plugin-editor-viewmode.md) ^35.0.0
- [@atlaskit/editor-plugin-ui-control-registry](https://npm.io/package/@atlaskit/editor-plugin-ui-control-registry.md) ^27.0.0

## Recent versions

- 35.0.2 (latest) — 2026-11-18
- 35.0.1 — 2026-11-17
- 35.0.0 — 2026-11-17
- 34.0.0 — 2026-11-17
- 33.1.0 — 2026-11-17
- 33.0.0 — 2026-11-16
- 32.0.20 — 2026-11-16
- 32.0.19 — 2026-11-13
- 32.0.18 — 2026-11-12
- 32.0.17 — 2026-11-11
- 32.0.16 — 2026-11-09
- 32.0.15 — 2026-11-07
- 32.0.14 — 2026-11-06
- 32.0.13 — 2026-11-05
- 32.0.12 — 2026-11-05
- … 517 more at https://npm.io/package/@atlaskit/editor-plugin-code-block/versions

## README

# Editor Plugin Code Block

Code Block plugin for @atlaskit/editor-core

**Note:** This component is designed for internal Atlassian development.
External contributors will be able to use this component but will not be able to submit issues.

## Overview

The code block plugin extends the Atlassian Editor with rich code editing functionality. It provides the code block node with language selection and IDE-like keyboard shortcuts for a better code editing experience.

## Key features

- **Language Selection** - Support for multiple programming languages
- **IDE-like Keyboard Shortcuts** - Auto-closing brackets and quotes, smart indentation
- **Line Numbers** - Display of line numbers and tracking of line positions
- **Word Wrapping** - Support for toggling word wrap in code blocks
- **Toolbar Support** - Floating toolbar with language selector and additional actions
- **Quick Insert** - Insert code blocks using the quick insert menu with `/` or ` ``` `

## Install
---
- **Install** - *yarn add @atlaskit/editor-plugin-code-block*
- **npm** - [@atlaskit/editor-plugin-code-block](https://www.npmjs.com/package/@atlaskit/editor-plugin-code-block)
- **Source** - [Bitbucket](https://bitbucket.org/atlassian/atlassian-frontend/src/master/packages/editor/editor-plugin-code-block)
- **Bundle** - [unpkg.com](https://unpkg.com/@atlaskit/editor-plugin-code-block/dist/)

## Usage
---
**Internal use only**

@atlaskit/editor-plugin-code-block is intended for internal use by the @atlaskit/editor-core and as a plugin dependency of the Editor within your product.

Direct use of this component is not supported.

Please see [Atlaskit - Editor plugin code block](https://atlaskit.atlassian.com/packages/editor/editor-plugin-code-block) for documentation and examples for this package.

### Plugin Configuration

The plugin accepts the following configuration options via `CodeBlockPluginOptions`:

- `allowCopyToClipboard`: Enable/disable the copy to clipboard button (boolean)
- `overrideLanguageName`: Function to customize language display names
- `useLongPressSelection`: Enable long-press selection on mobile (boolean)
- `allowCompositionInputOverride`: Allow composition input override on mobile (boolean)

### Plugin Actions

The plugin provides the following action:

- `insertCodeBlock(inputMethod)`: Insert a code block at the current selection with analytics tracking

## Support
---
For internal Atlassian, visit the slack channel [#help-editor](https://atlassian.slack.com/archives/CFG3PSQ9E) for support or visit [go/editor-help](https://go/editor-help) to submit a bug.

## License
---
Please see [Atlassian Frontend - License](https://hello.atlassian.net/wiki/spaces/AF/pages/2589099144/Documentation#License) for more licensing information.

---
_Source: https://npm.io/package/@atlaskit/editor-plugin-code-block · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
