# Installation

> Install the DOCX editor in React or Vue, add the stylesheet, and set a client-only boundary for server-rendered apps.

Source: https://www.docx-editor.dev/docs/2.x/installation

---
## Install packages

Install one adapter and the engine. Each adapter declares `@docx-editor.dev/core` as a peer and needs one shared copy.

#### React

```bash
npm install @docx-editor.dev/react @docx-editor.dev/core
```

#### Vue

```bash
npm install @docx-editor.dev/vue @docx-editor.dev/core
```


Add optional packages as your app needs them:

| Package | Adds | License |
| --- | --- | --- |
| `@docx-editor.dev/pro` | Tracked changes, comments, and custom nodes | [EigenPal Pro License](https://www.docx-editor.dev/pricing) |
| `@docx-editor.dev/editor-api` | Office.js-compatible editing on a server or with an open editor. Install with `@docx-editor.dev/core`. | [EigenPal Pro License](https://www.docx-editor.dev/pricing) |
| `@docx-editor.dev/fonts` | Open-licensed substitutes for common DOCX default fonts | Apache-2.0 AND OFL-1.1 AND LicenseRef-GUST-Font-License |

## Check runtime requirements

| Runtime                                                  | Supported versions       |
| -------------------------------------------------------- | ------------------------ |
| React                                                    | `^18 \|\| ^19`           |
| Vue                                                      | `^3.3`                   |
| Node.js (SSR, headless automation, build-time rendering) | `^20.16.0 \|\| >=22.3.0` |

Text measurement needs a text shaper. On an older Node.js version the shaper does not start, and the engine reports the Node.js version as the cause. Browser-only apps do not need Node.js.

## Add styles and a container

Import the stylesheet once and give the parent a height:

#### React

```tsx
import { DocxEditor } from '@docx-editor.dev/react';
import '@docx-editor.dev/core/styles/editor.css';

export default function App() {
  return (
    <div style={{ height: '100vh' }}>
      <DocxEditor document="blank" />
    </div>
  );
}
```

#### Vue

```vue
<script setup lang="ts">
import { DocxEditor } from '@docx-editor.dev/vue';
import '@docx-editor.dev/vue/styles.css';
</script>

<template>
  <div style="height: 100vh">
    <DocxEditor document="blank" />
  </div>
</template>
```


- The stylesheet is required. The Vue stylesheet imports the same core stylesheet that React uses.
- `<DocxEditor>` fills its parent. A parent without a height collapses, and the editor does not appear.
- Your app does not need Tailwind or an icon font. The precompiled CSS uses the `.docx-editor` scope.

For a complete load and save flow, see the [quickstart](/docs/2.x/quickstart).

## Choose a framework setup

The editor uses the DOM to measure text, so it renders on the client only. Server-rendered frameworks need a client-only boundary.

| Framework | Boundary | Guide |
| --- | --- | --- |
| Vite with React | None | [Vite](/docs/2.x/frameworks/vite) |
| Vite with Vue | None | [Vite with Vue](/docs/2.x/frameworks/vite-vue) |
| Next.js | `dynamic()` with `ssr: false` | [Next.js](/docs/2.x/frameworks/nextjs) |
| Remix | Mount check and `React.lazy` | [Remix](/docs/2.x/frameworks/remix) |
| Astro | React island with `client:only` | [Astro](/docs/2.x/frameworks/astro) |
| Nuxt | `.client.vue` component | [Nuxt](/docs/2.x/frameworks/nuxt) |

## Test a canary build

Canary builds publish each night from `main` when it has unreleased changes that passed CI. They have no support guarantee. Use the `canary` tag on every `@docx-editor.dev` package in your app:

```bash
npm install @docx-editor.dev/react@canary @docx-editor.dev/core@canary
```

- A canary version looks like `2.35.0-canary.20261103032300.sha-b20ba9f`: next release, UTC build time, and source commit.
- The packages of one canary pin each other to that exact version. Install every package from the same tag.
- Version ranges such as `^2.34.0` never select a canary.

## Next steps

- [Quickstart](/docs/2.x/quickstart): Load, edit, and save a `.docx`.
- [Fonts and measurement](/docs/2.x/guides/fonts): Load fonts for accurate line and page breaks.
- [Editing API](/docs/2.x/editor-api): Edit documents without a browser.
