Skip to content
Keshavkumar04Public

About

open source library for PowerPoint

Topics

Resources

Stars

39 stars

Watchers

1 watching

Forks

Repository files navigation

PptEditor

🎨 An embeddable presentation editor component for React

React TypeScript Vite Tailwind CSS dnd kit


🧭 Overview

@ppteditor/react is a full-featured PowerPoint-style presentation editor that drops into any React app as a single component. It supports rich-text slides, shapes, tables, themes, and real .pptx import and export — so users can open existing PowerPoint files, edit them in the browser, and download them again.

import { PresentationEditor } from '@ppteditor/react';
import '@ppteditor/react/style.css';

export default function App() {
  return (
    <PresentationEditor
      initialData={null}
      onChange={(data) => console.log('Changed:', data.name)}
      onSave={(data) => console.log('Saved:', data.name)}
      style={{ height: '100vh' }}
    />
  );
}

✨ Features

  • 🧩 Drop-in component — <PresentationEditor />, no setup required
  • 📑 Slide management — add, reorder, duplicate, and pick layouts
  • 🔤 Rich text boxes — full text formatting and styling
  • 🔷 Shapes & tables — insert and edit shapes and data tables
  • 🎨 Theme system — built-in themes plus a custom theme editor
  • 📂 PPTX import — open existing .pptx files in the editor
  • 💾 PPTX export — download presentations as real PowerPoint files
  • ↩️ Undo / redo — full editing history
  • 💬 Comments — annotate slides with comments
  • 🖱️ Drag & drop — powered by dnd-kit

📦 Installation

npm install @ppteditor/react

🚀 Usage

import { PresentationEditor } from '@ppteditor/react';
import '@ppteditor/react/style.css';

function MyEditor() {
  return (
    <PresentationEditor
      initialData={null}
      onChange={(presentation) => {
        // called on every edit
      }}
      onSave={(presentation) => {
        // persist the presentation
      }}
      style={{ height: '100vh' }}
    />
  );
}

Programmatic import / export

The package also exports helpers for working with .pptx files directly:

import {
  importPptx,        // parse a .pptx File into a Presentation
  exportPptx,        // build a .pptx from a Presentation
  exportAndDownload, // build + trigger a browser download
  isPptxFile,        // validate a File is a .pptx
  BUILT_IN_THEMES,   // ready-made themes
  createNewTheme,    // create a custom theme
} from '@ppteditor/react';

🛠️ Exports

Export Description
PresentationEditor The main editor component
PresentationEditorHandle Ref handle type for the editor
PresentationEditorProps Props type for the editor
importPptx / isPptxFile Parse and validate .pptx files
exportPptx / downloadPptx / exportAndDownload Export to .pptx
BUILT_IN_THEMES / createNewTheme Theme data & helpers
generateId ID generation utility
Type definitions Presentation, Slide, SlideElement, EditorState, and more

💻 Local Development

# Clone the repository
git clone https://github.com/Keshavkumar04/ppteditor.git
cd ppteditor

# Install dependencies
npm install

# Run the demo app
npm run dev

# Build the library
npm run build

🧱 Tech Stack

Area Technologies
Core React, TypeScript, Vite
Drag & drop dnd-kit
PPTX jszip, pptxgenjs
UI Tailwind CSS, Radix UI, Lucide

📁 Project Structure

ppteditor/
└── src/
    ├── components/   # Editor, canvas, toolbar, panels, elements
    ├── context/      # Editor / history / selection / theme contexts
    ├── services/     # pptx import & export
    ├── data/         # Built-in themes
    ├── types/        # Public type definitions
    ├── utils/        # Geometry, colors, formatting helpers
    └── index.ts      # Public package entry point

Built with 🧡 by Keshav Kumar

About

open source library for PowerPoint

Topics

Resources

Stars

39 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages