Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

redocx

> 前端框架
Open source

Create word documents with React

1.4K stars0 likes3 views
WebsiteGitHub

About

Create word documents with React

redocx

Create word documents with React

Introduction

redocx is a library which lets you create word documents with React. It provides a set of components which renders your declarative views and components to word documents.

Example

A simple component that renders a "Hello World" text to a word document.

javascript
import React from 'react'
import { render, Document, Text } from 'redocx'

class App extends React.Component {
  render() {
    return (
      <Document>
        <Text>Hello World</Text>
      </Document>
    )
  }
}

render(<App />, `${__dirname}/example.docx`)

Let's get started!

Install

Babel presets and cli

bash
npm install --save-dev babel-cli babel-core babel-preset-env babel-preset-react babel-preset-stage-0

react and redocx

bash
npm install --save react redocx

Usage

  • Create a .babelrc
{
  "presets": [
    "env",
    "stage-0",
    "react"
  ]
}
  • After configuring babel and assuming you've already created a file example.js with this example, run babel-node example.js. This will render your React component to word document.

Demo

bash
git clone https://github.com/nitin42/redocx.git
cd redocx
npm install
npm run example

Documentation

See the detailed documentation here

Contributing

Contributing guide

License

MIT

Issues· 13 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

JavaScriptcomponentslibraryreactreact-fiber

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架