Documents Template Studio is a React functional sample that provides a centralized workspace for creating, managing, and editing DOCX document templates using the Syncfusion® React DOCX Editor (Document Editor).
The sample is designed for where organizations need reusable templates for donor communications, receipts, reminders, and impact letters.
Users can:
- View available document templates from a dashboard.
- Open a template in the Syncfusion Word-like Document Editor.
- View merge fields associated with the selected template.
- Insert merge fields into the document.
- Create a new blank template.
- Upload an existing DOCX template.
- Customize and save templates.
- Execute mail merge with a JSON data source and preview the merged document.
- Remove templates from the application.
Selecting a template opens it directly in the Syncfusion DOCX Editor.
Users can customize the document using standard Word-like editing capabilities, including text formatting, tables, images, and other supported DOCX content.
The right-side merge-field panel displays the fields available for the selected template.
Users can select a field to insert it into the document.
The sample also supports adding custom merge fields either to the current template or to the common field catalog.
Users can:
- Create a new blank template.
- Upload an existing
.docxtemplate. - Provide template metadata such as name, category, and purpose.
- Open and customize uploaded templates in the editor.
The Save and Publish action saves the current document as a DOCX template through the ASP.NET Core server.
The saved template is stored under:
Server-side/wwwroot/Templates/
The Preview with Mail Merge action sends the current DOCX content and JSON merge data to the server.
The ASP.NET Core server uses Syncfusion Word Library (DocIO) to execute the mail merge and generate a DOCX document for display in the Syncfusion DOCX Editor.
- Node.js
- npm
- .NET 10 SDK
- ASP.NET Core runtime
- Syncfusion ASP.NET Core and DocIO packages referenced by the project
The sample consists of two applications:
- ASP.NET Core Web API – provides the server-side APIs required by the Syncfusion Document Editor.
- React application – provides the client-side application.
Start the ASP.NET Core Web API server first because the React application uses the server for DOCX import, save, and Mail Merge operations.
Open a terminal in:
Server-side/
Run:
dotnet restore
dotnet runThe configured development URL is:
http://localhost:5212
The Document Editor service URL used by the React application is:
http://localhost:5212/api/documenteditor/
Keep this terminal running while using the React application.
Before installing the React dependencies or starting the React application, open:
src/data/sampleTemplates.js
Locate the following configuration:
export const DOCUMENT_EDITOR_BASE_URL = 'http://localhost:5212';Update DOCUMENT_EDITOR_BASE_URL to match the URL where your ASP.NET Core Web API is running.
For example:
export const DOCUMENT_EDITOR_BASE_URL = 'http://localhost:5212';Open another terminal in:
Client-side/
Install dependencies:
npm installStart the development server:
npm run devOpen the URL shown by Vite in the terminal, normally:
http://localhost:5173
The sample uses a JSON string for Mail Merge data.
For example, a Pledge Payment Reminder template can use:
{
"Organization": [
{
"OrgName": "ABC Foundation",
"OrgAddress": "123 Main Street, New York, NY 10001",
"ReminderDate": "August 20, 2026",
"DonorName": "Nancy",
"DonorAddress": "45 Oak Street, New York, NY 10002",
"PledgeNumber": "PLG-2026-0042",
"PledgeDate": "July 15, 2026",
"PledgeAmount": "$2,500.00",
"AmountPaid": "$1,500.00",
"OutstandingAmount": "$1,000.00",
"DueDate": "September 15, 2026",
"PaymentMethod": "Online Payment",
"ContactEmail": "donations@abcfoundation.org",
"ContactPhone": "+1-212-555-0123"
}
]
}The main Document Editor endpoints used by the sample are:
| Endpoint | Purpose |
|---|---|
POST /api/documenteditor/Import |
Imports a DOCX and converts it to SFDT. |
POST /api/documenteditor/Save |
Saves the edited SFDT content as a DOCX template. |
POST /api/documenteditor/MailMerge |
Executes Mail Merge using the supplied JSON data and returns SFDT. |
-
Product page: Syncfusion® React DOCX Editor
-
Documentation: Syncfusion® React DOCX Editor - Documentation
-
Online demo: Syncfusion® React DOCX Editor - Online demo
For any other queries, reach our Syncfusion® support team or post the queries through the community forums.
Request new feature through Syncfusion® feedback portal.
This is a commercial product and requires a paid license for possession or use Syncfusion's licensed software, including this component, is subject to the terms and conditions of Syncfusion's EULA. You can purchase a licnense here or start a free 30-day trial here.