A rich document editor built with Next.js, React, TypeScript, and TipTap. It includes formatting tools, page layout controls, image handling, table editing, PDF/Word export, and a polished landing experience.
- Rich text editing with headings, lists, blockquotes, code, links, tables, and inline formatting
- Focus mode, A4 layout mode, and multi-page editing tools
- Header, footer, page number, and table of contents support
- Image upload with resize controls
- PDF and Word export options
- Dark mode and responsive UI
- Next.js 15
- React 18
- TypeScript
- TipTap
- Tailwind CSS
- Radix UI
- Node.js 18 or newer
- npm
git clone https://github.com/amananandrai/document-editor-with-tiptap.git
cd document-editor-with-tiptap
npm installnpm run devOpen http://localhost:3000.
npm run devstarts the development servernpm run buildcreates a production buildnpm run startruns the production buildnpm run lintruns ESLintnpm run testruns Jest testsnpm run test:watchruns Jest in watch modenpm run test:coveragegenerates coverage outputnpm run test:ciruns tests in CI mode
app/
contact-us/
page.tsx # Contact page
documentation/
page.tsx # Documentation page
editor/
editor-client.tsx # Client wrapper for the editor experience
features.js # Landing-page feature metadata
layout.tsx # Focus mode provider for editor routes
page.tsx # Main editor page
help-center/
page.tsx # Help center page
globals.css # Global design tokens and base styles
layout.tsx # Root app layout
page.tsx # Landing page
components/
editor/
find-replace-modal.tsx # Find and replace functionality
header-footer.tsx # Header and footer components
image-extension.ts # Image extension for TipTap
image-resize-component.tsx
link-modal.tsx # Link insertion modal
margin-ruler.tsx # Margin ruler component
page-break-component.tsx
page-break-extension.tsx
rich-editor.tsx # Main rich text editor
status-bar.tsx # Editor status bar
tiptap-extensions.ts # TipTap extension helpers
toc-extension.tsx # Table of contents extension
toolbar.tsx # Editor toolbar
use-image-upload.ts # Image upload hook
ui/
backButton.tsx
button.tsx
colorpicker.tsx
dialog.tsx
dropdown-menu.tsx
input.tsx
label.tsx
popover.tsx
tooltip.tsx
BackToTopButton.tsx
focus-mode-context.tsx
footer.tsx
navbar.tsx
RootLayoutClient.tsx
theme-provider.tsx
theme-toggle.tsx
lib/
local-storage.ts
utils.ts
public/
logo.png
pattern-bg.svg
placeholder-bg.jpg
__tests__/
components/
lib/
setup/
- The active editor lives under
components/editor/. - Global styling is defined in
app/globals.css. - Shared UI building blocks live in
components/ui/and are used across the editor, navigation, dialogs, and controls.
Update the design tokens in app/globals.css to change colors, radius values, and shared theme settings.
Editor extensions are composed in components/editor/rich-editor.tsx, with reusable extension helpers in components/editor/tiptap-extensions.ts.
Shared UI building blocks live in components/ui/ and are used across the editor, navigation, dialogs, and controls.
npm run test
npm run test:watchThis project can be deployed anywhere that supports Next.js, including Vercel, Netlify, Railway, and AWS Amplify.
- Issues: GitHub Issues
- Discussions: GitHub Discussions