@cordel/react-docx
v0.1.0
Published
Create DOCX documents using React components
Downloads
132
Maintainers
Readme
@cordel/react-docx
Create DOCX documents using React components.
- Website: https://react-docx.com
- Documentation: https://react-docx.com/learn/getting-started/introduction
- Error codes: https://react-docx.com/docs/errors
Requirements:
- Node.js
>=20.0.0 - React
>=19.2.0 - Node runtime only (not browser/edge runtimes)
Installation
npm install @cordel/react-docx
# or
pnpm add @cordel/react-docx
# or
yarn add @cordel/react-docxQuick Example
import { Document, Section, Paragraph, Text, render } from "@cordel/react-docx";
const MyDocument = () => (
<Document>
<Section>
<Paragraph>
<Text className="text-2xl font-bold text-blue-600">
Hello, World!
</Text>
</Paragraph>
</Section>
</Document>
);
const { outputPath, diagnostics } = await render(<MyDocument />, "./output.docx");
console.log(outputPath, diagnostics.length);License
PolyForm Noncommercial 1.0.0. See LICENSE.
