Packages
What to install from npm, crates.io, and PyPI, and what each package does
BetterOffice provides DOCX, XLSX, and PPTX packages for JavaScript, Rust, and Python. Choose a runtime below, then select the packages for your file format.
| Runtime | Install | Guide |
|---|---|---|
| Browser, React, or Node | npm install @betteroffice/docx-react | JavaScript |
| Native Rust | cargo add betteroffice-docx | Rust |
| Python | pip install betteroffice-docx | Python |
Packages by format
| Format | npm | crates.io | PyPI |
|---|---|---|---|
| DOCX | @betteroffice/docx, @betteroffice/docx-react | betteroffice-docx | betteroffice-docx |
| XLSX | @betteroffice/xlsx, @betteroffice/xlsx-react | betteroffice-xlsx | betteroffice-xlsx |
| PPTX | @betteroffice/pptx, @betteroffice/pptx-react | betteroffice-pptx | betteroffice-pptx |
All three registries carry DOCX, XLSX, and PPTX. The core, React, and locale packages for each format are released together. Version numbers differ between formats and registries; use the registry links for current releases.
VSDX is available from source with a browser demo. Its npm packages and Rust crates are not yet published.
Fonts
The font packages provide open, metric-compatible alternatives to common Microsoft fonts, plus Hebrew, Arabic, and CJK coverage.
| Package | Contents |
|---|---|
@betteroffice/fonts | Carlito, Caladea, Liberation Sans/Serif/Mono, Gelasio, Comic Relief, Inter, Roboto, Source Sans 3, DM Sans, DM Serif Display, Open Sans, Montserrat, Poppins, Oswald, Heebo, Noto Hebrew/Arabic |
@betteroffice/fonts-cjk | Noto Sans SC/TC/JP/KR, Noto Serif SC |
For the DOCX editor, install @betteroffice/fonts and configure it before
mounting the editor:
import { configureDefaultFonts } from "@betteroffice/docx/layout";
import * as fonts from "@betteroffice/fonts";
configureDefaultFonts({ fonts });To host the font files on your own CDN, pass baseUrl alongside fonts. The
module provides the font manifest and is required with either asset location.
Install @betteroffice/fonts-cjk when you need Chinese, Japanese, or Korean text.
Both packages are optional and must be installed explicitly.
Missing font bytes can cause fallback measurements and different pagination. See the language guides for font setup in other formats and runtimes.
Choose an API
- React editor: use a
-reactpackage for the toolbar, canvas, selection, keyboard controls, and review UI. - Custom JavaScript UI: use a framework-free core for editing, display lists, and hit-testing.
- Native Rust: use a
betteroffice-docx,betteroffice-xlsx, orbetteroffice-pptxcrate. - Python scripts and services: use the corresponding package on PyPI.
- Individual engine components: use the parsing, editing, or rendering crates listed in the Rust guide.
Release notes and each package's changelog record shipped changes.
Visual fidelity results compare published packages and source builds with Microsoft Office on selected corpus files. The comparison harness describes the measurement method.