# @codemirror/view

> DOM view component for the CodeMirror code editor

Latest version **6.43.11** (published 2026-09-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install @codemirror/view
pnpm add @codemirror/view
yarn add @codemirror/view
bun add @codemirror/view
```

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 6.43.11 |
| Published | 2026-09-03 |
| First published | 2020-12-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 1.2 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Marijn Haverbeke |
| Maintainers | marijn |
| Keywords | editor, code |

## Links

- npm: https://www.npmjs.com/package/@codemirror/view
- Repository: https://code.haverbeke.berlin/codemirror/view
- npm.io page: https://npm.io/package/@codemirror/view

## Dependencies (4)

- [crelt](https://npm.io/package/crelt.md) ^1.0.6
- [style-mod](https://npm.io/package/style-mod.md) ^4.1.0
- [w3c-keyname](https://npm.io/package/w3c-keyname.md) ^2.2.4
- [@codemirror/state](https://npm.io/package/@codemirror/state.md) ^6.7.0

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 6.43.11 (latest) — 2026-09-03
- 6.39.0-beta.5 (beta) — 2025-12-03
- 6.26.4-edit-context.1 (edit-context) — 2024-04-21
- 6.43.10 — 2026-08-31
- 6.43.9 — 2026-08-16
- 6.43.8 — 2026-08-04
- 6.43.7 — 2026-07-27
- 6.43.6 — 2026-07-06
- 6.43.5 — 2026-07-04
- 6.43.4 — 2026-06-27
- 6.43.3 — 2026-06-25
- 6.43.2 — 2026-06-23
- 6.43.1 — 2026-06-09
- 6.43.0 — 2026-05-14
- 6.42.1 — 2026-05-07
- … 241 more at https://npm.io/package/@codemirror/view/versions

## README

# @codemirror/view [![NPM version](https://img.shields.io/npm/v/@codemirror/view.svg)](https://www.npmjs.org/package/@codemirror/view)

[ [**WEBSITE**](https://codemirror.net/) | [**DOCS**](https://codemirror.net/docs/ref/#view) | [**ISSUES**](https://code.haverbeke.berlin/codemirror/dev/issues) | [**FORUM**](https://discuss.codemirror.net/) | [**CHANGELOG**](https://code.haverbeke.berlin/codemirror/view/src/branch/main/CHANGELOG.md) ]

This package implements the DOM view component for the
[CodeMirror](https://codemirror.net/) code editor.

The [project page](https://codemirror.net/) has more information, a
number of [examples](https://codemirror.net/examples/) and the
[documentation](https://codemirror.net/docs/).

This code is released under an
[MIT license](https://code.haverbeke.berlin/codemirror/view/tree/main/LICENSE).

We aim to be an inclusive, welcoming community. To make that explicit,
we have a [code of
conduct](http://contributor-covenant.org/version/1/1/0/) that applies
to communication around the project.

## Usage

```javascript
import {EditorView} from "@codemirror/view"
import {basicSetup} from "codemirror"

const view = new EditorView({
  parent: document.querySelector("#some-node"),
  doc: "Content text",
  extensions: [basicSetup /* ... */]
})
```

Add additional extensions, such as a [language
mode](https://codemirror.net/#languages), to configure the editor.
Call
[`view.dispatch`](https://codemirror.net/docs/ref/#view.EditorView.dispatch)
to update the editor's state.

---
_Source: https://npm.io/package/@codemirror/view · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
