Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including redocx with all npm packages installed. Try it out:

var redocx = require("redocx")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

redocx v1.1.4

Create word documents with React


Build Status yarn license status

Create word documents with React


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.


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

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

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

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

Let's get started!


Babel presets and cli

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

react and redocx

npm install --save react redocx


  • Create a .babelrc
  "presets": [
  • 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.


git clone
cd redocx
npm install
npm run example


See the detailed documentation here


Contributing guide





RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free