//document-editor-with-tiptapbydavidzcode

document-editor-with-tiptap

This repository is a Text Editor made using React library Tiptap

0
0
0
TypeScript

πŸ“ DocuEdit Pro

A powerful, feature-rich document editor built with modern web technologies. Create, edit, and format documents with professional-grade tools, featuring a beautiful interface and seamless export capabilities.

DocuEdit Pro
React
TypeScript
TipTap

✨ Features

🎨 Rich Text Editing

  • undefinedHeadings & Paragraphs: Support for H1-H4 headings with proper hierarchy
  • undefinedText Formatting: Bold, italic, underline, superscript, and subscript
  • undefinedFont Customization: Multiple font families (System, Serif, Monospace) and sizes (12px-48px)
  • undefinedLine Spacing: Adjustable line height options (1, 1.15, 1.5, 2)
  • undefinedLists: Bullet and ordered lists with proper nesting and indentation
  • undefinedColors: Text color and background highlighting with color picker
  • undefinedIndentation: Custom indent system for paragraphs and headings

🎯 Advanced Features

  • undefinedKeyboard Shortcuts: Ctrl/Cmd + B/I/U for quick formatting
  • undefinedExport Capabilities:
    • PDF export using html2pdf.js
    • Word document export (.doc format)
  • undefinedTheme Support: Beautiful dark/light mode with system preference detection
  • undefinedResponsive Design: Mobile-friendly interface
  • undefinedAccessibility: ARIA labels and keyboard navigation support

πŸ› οΈ Technical Features

  • undefinedModern Stack: Next.js 15, React 18, TypeScript
  • undefinedRich Editor: TipTap with custom extensions
  • undefinedUI Components: Radix UI primitives with shadcn/ui
  • undefinedStyling: Tailwind CSS with OKLCH color system
  • undefinedPerformance: Optimized with dynamic imports and proper SSR handling

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • bun

Installation

  1. undefinedClone the repositoryundefined

    git clone https://github.com/yourusername/document-editor-with-tip-mukutap.git
    cd document-editor-with-tip-mukutap
    
  2. undefinedInstall dependenciesundefined

    bun install
    
  3. undefinedRun the development serverundefined

    bun run dev
    
  4. undefinedOpen your browserundefined
    Navigate to http://localhost:3000

πŸ“ Project Structure

β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ (editor)/
β”‚   β”‚   β”œβ”€β”€ editor-client.tsx    # Client-side editor wrapper
β”‚   β”‚   └── page.tsx              # Main editor page
β”‚   β”œβ”€β”€ layout.tsx               # Root layout with navbar/footer
β”‚   └── globals.css              # Global styles with design tokens
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ editor/
β”‚   β”‚   β”œβ”€β”€ rich-editor.tsx       # Main TipTap editor component
β”‚   β”‚   β”œβ”€β”€ toolbar.tsx           # Comprehensive toolbar
β”‚   β”‚   └── tiptap-extensions.ts  # Custom extensions
β”‚   β”œβ”€β”€ navbar.tsx               # Custom navigation bar
β”‚   β”œβ”€β”€ footer.tsx               # Footer component
β”‚   β”œβ”€β”€ theme-provider.tsx        # Theme context provider
β”‚   β”œβ”€β”€ theme-toggle.tsx          # Dark/light mode toggle
β”‚   └── ui/                       # shadcn/ui components
β”œβ”€β”€ lib/
β”‚   └── utils.ts                  # Utility functions
└── public/                       # Static assets

🎨 Customization

Theme Customization

The project uses a custom design system with OKLCH color space for better color consistency. You can customize colors in app/globals.css:

:root {
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  /* ... more color tokens */
}

Adding New Extensions

Create custom TipTap extensions in components/editor/tiptap-extensions.ts:

import { Extension } from "@tiptap/core"

export const CustomExtension = Extension.create({
  name: "customExtension",
  // Your extension logic here
})

Styling Components

The project uses Tailwind CSS with custom design tokens. Components are styled using the cn() utility function for conditional classes.

πŸš€ Deployment

Vercel (Recommended)

  1. Push your code to GitHub
  2. Connect your repository to Vercel
  3. Deploy with zero configuration

Other Platforms

The project can be deployed to any platform that supports Next.js:

  • Netlify
  • AWS Amplify
  • Railway
  • DigitalOcean App Platform

πŸ“¦ Available Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run start - Start production server
  • npm run lint - Run ESLint

πŸ§ͺ Testing

# Run tests (when implemented)
npm run test

# Run tests in watch mode
npm run test:watch

πŸ“š API Reference

Editor Component

import { RichEditor } from '@/components/editor/rich-editor'

// Basic usage
<RichEditor />

Custom Extensions

import { IndentExtension, LineHeightExtension } from '@/components/editor/tiptap-extensions'

// Use in editor configuration
const editor = useEditor({
  extensions: [
    StarterKit,
    IndentExtension,
    LineHeightExtension,
  ],
})

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details on how to contribute to this project.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

πŸ“ž Support


Made with ❀️ using Next.js & TipTap

Β© 2025 DocuEdit Pro. All rights reserved.

Find me
[beta]v0.20.0