Customization

Overview

Customize your PPTX editor with CSS themes, React and Vue parts, the toolbar, menus, and dialogs.

Customize your PPTX editor to fit your application. Each guide lists the supported options and shows React and Vue reference code. Start with props and CSS, then compose parts when you need a different layout.

Live examples

The demo app in examples/vite/ composes these parts into a complete editor. In a checkout of the repository, run bun install and bun run dev, then open http://localhost:5274/.

Design principles

The PPTX editor separates presentation editing from interface controls. Every part reads the same editor state and runs the same commands as the packaged editor.

Start with the smallest change that fits your application:

  • Appearance: Set --doc-* CSS properties on .acme-theme .pptx-editor, where .acme-theme is a wrapper around PptxEditor.Root. Use className and data-active or data-disabled to style controls. Set colorMode for dark controls.
  • Composition: Use PptxEditor.Root, .Viewport, .Content, and the panes to arrange the interface. Keep every part inside Root.
  • Individual controls: Use named parts such as PptxEditor.Toolbar.Bold. Replace an icon with icon, or supply your own element with asChild.
  • Control sets: Override a slot in place, use hidden to remove it, or set preset={false} to compose the toolbar, a menu, or a dialog yourself.
  • Custom behavior: Use useEditorCommand(slotId) for command state and execution. Use useEditorState(selector) for the state your control shows.

Keep the slide selection when you build custom controls: a chrome mousedown calls preventDefault(), except on inputs, selects, and text areas. Keep labels, keyboard support, and disabled reasons accessible. A disabled control stays focusable with aria-disabled and tells the user why it is disabled.

Hiding a control changes the interface only. The operation keeps working from menus, keyboard shortcuts, and the API.

Customization guides

Choose the API level

LevelUse
Props and CSS tokensChange labels, colors, and color mode.
Named partsArrange controls and replace selected elements.
Hooks and composablesConnect application controls to editor state and commands.
ModulesAdd review, collaboration, or drawing effects (glow, inner shadow, reflection, soft edge) with @pptx-editor.dev/pro (EigenPal Pro License). Pass them in the modules prop of PptxEditor or its root; the editor reads it once, when it is created. See Capability modules for an example.

React and Vue reference

Compose the same workspace in either adapter:

import { PptxEditor } from '@pptx-editor.dev/react';
import '@pptx-editor.dev/core/styles/editor.css';

export function DeckEditor({ bytes }: { bytes: Uint8Array }) {
  return (
    <div className="acme-theme">
      <PptxEditor.Root document={bytes} colorMode="system">
        <PptxEditor.Viewport className="deck-workspace">
          <PptxEditor.Menu />
          <div className="deck-workspace__dock">
            <PptxEditor.Toolbar />
          </div>
          <div className="deck-workspace__body">
            <PptxEditor.SlideRail />
            <div className="deck-workspace__main">
              <PptxEditor.Content />
              <PptxEditor.FindBar />
              <PptxEditor.EditNotice />
              <PptxEditor.FontNotice />
              <PptxEditor.NotesPane />
              <PptxEditor.ZoomPill />
            </div>
          </div>
          <PptxEditor.Slideshow />
        </PptxEditor.Viewport>
      </PptxEditor.Root>
    </div>
  );
}

The deck-workspace classes are your own layout CSS. Workspace layout lists it.

The adapters expose the same editing commands and components. Vue uses named exports such as PptxEditorToolbar for React's PptxEditor.Toolbar.

More control

See the API reports for @pptx-editor.dev/react and @pptx-editor.dev/vue for every part and type.

See also