- Notifications
You must be signed in to change notification settings - Fork72
📄 Create word documents with React
NotificationsYou must be signed in to change notification settings
nitin42/redocx
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
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.
importReactfrom'react'import{render,Document,Text}from'redocx'classAppextendsReact.Component{render(){return(<Document><Text>Hello World</Text></Document>)}}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": [ "env", "stage-0", "react" ]}
- After configuring babel and assuming you've already created a file
example.js
withthis example, runbabel-node example.js
. This will render your React component to word document.
git clone https://github.com/nitin42/redocx.gitcd redocxnpm installnpm run example
See the detailed documentationhere
MIT
About
📄 Create word documents with React
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.