<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Janos Breuer</title>
    <description>The latest articles on DEV Community by Janos Breuer (@janosbreuer).</description>
    <link>https://dev.to/janosbreuer</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4186558%2Fa968ec47-5dc4-43b6-8e73-2f8dd034a694.png</url>
      <title>DEV Community: Janos Breuer</title>
      <link>https://dev.to/janosbreuer</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/janosbreuer"/>
    <language>en</language>
    <item>
      <title>I built a React library to generate editable Google Docs with JSX</title>
      <dc:creator>Janos Breuer</dc:creator>
      <pubDate>Fri, 16 Oct 2026 08:25:44 +0000</pubDate>
      <link>https://dev.to/janosbreuer/i-built-a-react-library-to-generate-editable-google-docs-with-jsx-56i5</link>
      <guid>https://dev.to/janosbreuer/i-built-a-react-library-to-generate-editable-google-docs-with-jsx-56i5</guid>
      <description>&lt;p&gt;I was building a contract-generation system when we reached a point where half the document lived in a Google Doc template and half in Google Apps Script.&lt;/p&gt;

&lt;p&gt;That was hard to maintain. The templates were split between Google Docs and Apps Script, outside the codebase where I could work on them with my usual tools and AI coding assistants.&lt;/p&gt;

&lt;p&gt;So I built &lt;a href="https://github.com/janosbreuer/react-gdoc" rel="noopener noreferrer"&gt;react-gdoc&lt;/a&gt;: an open-source TypeScript library that generates &lt;strong&gt;editable Google Docs&lt;/strong&gt; from React/JSX components.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it solves
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Keep your document templates in your TypeScript codebase, generate real Google Docs, and let people edit the result as usual.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For example, generate a contract or a project update from application data, then let someone finish it in Google Docs.&lt;/p&gt;

&lt;p&gt;You write the template as React components. TypeScript conditions decide which sections appear.&lt;/p&gt;

&lt;p&gt;Your app supplies Google authentication, while react-gdoc turns the component tree into Google Docs API &lt;code&gt;batchUpdate&lt;/code&gt; requests and handles the indexes, ranges, and table offsets.&lt;/p&gt;

&lt;p&gt;Google Docs uses character indexes to position and format content, and tables make that indexing even trickier. I wanted to write document components without having to think about those offsets every time.&lt;/p&gt;

&lt;p&gt;Install from GitHub (not on npm yet):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;github:janosbreuer/react-gdoc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Style your doc with Tailwind-like classes
&lt;/h2&gt;

&lt;p&gt;Familiar utilities such as &lt;code&gt;font-bold&lt;/code&gt;, &lt;code&gt;text-blue-800&lt;/code&gt;, or &lt;code&gt;mb-4&lt;/code&gt; map onto Google Docs styles. That's handy if you or an AI coding agent already think in that vocabulary. It's a supported subset, not your full Tailwind config.&lt;/p&gt;

&lt;p&gt;The result is a real Google Doc that you can open, share, and continue editing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F55nuc7c5gt9egzd2w6qq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F55nuc7c5gt9egzd2w6qq.png" alt="Rich text example with Tailwind-like styling" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Tables from React components
&lt;/h2&gt;

&lt;p&gt;You can build tables using JSX components, much like in HTML. Generate rows from your application data using &lt;code&gt;.map()&lt;/code&gt;, apply formatting, and let react-gdoc handle the tricky Google Docs table indexes.&lt;/p&gt;

&lt;p&gt;The result is a native, editable Google Docs table.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fil0xc7tyl21wsy9cteke.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fil0xc7tyl21wsy9cteke.png" alt="Tables example" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Preview without calling the Docs API
&lt;/h2&gt;

&lt;p&gt;In the cloned repository, you can iterate on a TSX template in the browser with Vite hot reload:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm run preview &lt;span class="nt"&gt;--&lt;/span&gt; example.tsx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The preview is an HTML approximation of the final Google Doc. When you're ready, the same file can go to a real Google Doc through the CLI or &lt;code&gt;renderDocument()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It's still an early library. Headings, paragraphs, lists, tables, named styles, and document creation and updates work. Images, equations, footnotes, and nested tables aren't supported yet.&lt;/p&gt;

&lt;p&gt;I'm interested in feedback, especially on what's still missing before this would be something you'd actually use.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/janosbreuer/react-gdoc" rel="noopener noreferrer"&gt;janosbreuer/react-gdoc&lt;/a&gt;&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>react</category>
      <category>typescript</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
