Skip to Content
OpenPreview

PowerPoint (PPTX)

Show PowerPoint decks (PPTX, PPTM, PPSX, POTX) in React with masters, layouts, all 187 preset shapes, tables, charts, speaker notes, media and a full-screen presenter.

Slides are drawn by our own renderer, following PowerPoint's master, layout and slide inheritance.

Live: slides.pptx rendered by the library in this page.Open in the playground

File types: .pptx, .pptm (macros are never run), .ppsx, .potx.

Supported

  • Design: theme colours and fonts, style references, backgrounds, master and layout placeholders.
  • Shapes: all 187 preset shapes and custom geometry, gradients, shadows, arrowheads, groups.
  • Content: text with bullets and numbering, pictures with cropping, tables with table styles, charts, SmartArt (from its saved drawing), EMF/WMF pictures, links.
  • Presenting: a full-screen presenter with slide transitions, speaker notes, hidden slides skipped, embedded audio and video playback.
  • Navigation: slide thumbnails, an outline from slide titles, search, and printing one slide per sheet.
Live: a deck with sound and transitions.Open in the playground

Controller

StateFor a presentation
pageKind, page, pageCount'slide', the slide most in view, and the number of slides. Hidden slides are shown, marked as hidden.
zoom, scaleEvery zoom works; 'fit-page' shows one whole slide at a time.
rotationNot supported.
outlineThe slide titles, one entry per slide, when the slides have titles.
thumbnailsOne per slide, drawn from the slide itself.
search.countMatches in slide text, tables, SmartArt and shapes.
canzoom, fit, search, print, download, sidebar.
Live: useDocViewer on slides.pptx. Press a command and watch the state change.

Things to know:

  • toggleFullscreen() shows the deck full screen; with 'fit-page' zoom each slide fills the screen, and next() and prev() move between slides.
  • Speaker notes, media playback and transitions are drawn in the surface.
  • print() prints one slide per sheet and skips hidden slides, as PowerPoint does.

Headless

A deck with a thumbnail strip, arrow-key navigation and a Present button:

examples/headless/powerpoint.tsx
'use client';
// A slide deck: one slide in view, a strip of slide thumbnails, arrow-key navigation, and a
// Present button that goes full screen.
import { DocumentSurface, Thumbnail, useDocViewer, useThumbnails, type DocSource } from '@openpreview/react';
import '@openpreview/react/styles.css';

export default function SlideDeck({ source }: { source: DocSource }) {
  const viewer = useDocViewer({ source, defaultZoom: 'fit-page' });
  const slides = useThumbnails(viewer);

  return (
    <div
      className="flex h-full flex-col text-sm"
      tabIndex={-1}
      onKeyDown={(e) => {
        if (e.key === 'ArrowRight') viewer.next();
        else if (e.key === 'ArrowLeft') viewer.prev();
        else viewer.onKeyDown(e); // PgUp/PgDn, Home/End, Ctrl+F, Ctrl+P…
      }}
    >
      <header className="flex items-center gap-3 border-b p-2">
        <button onClick={viewer.prev}>◀</button>
        <span>
          {viewer.pageKind === 'slide' ? 'Slide' : 'Page'} {viewer.page ?? '–'} / {viewer.pageCount}
        </span>
        <button onClick={viewer.next}>▶</button>
        <button className="ml-auto" onClick={viewer.toggleFullscreen}>Present</button>
      </header>
      <DocumentSurface viewer={viewer} className="min-h-0 flex-1" />
      {slides && (
        <footer className="flex gap-2 overflow-x-auto border-t p-2">
          {Array.from({ length: slides.count }, (_, i) => (
            <button key={i} aria-current={viewer.page === i + 1 || undefined} className="shrink-0 aria-[current]:outline-2" onClick={() => viewer.goTo(i + 1)}>
              <Thumbnail viewer={viewer} index={i} width={112} />
            </button>
          ))}
        </footer>
      )}
    </div>
  );
}
Live: the example above, built only with the public hooks, running on slides.pptx.

Not yet

  • Entrance and emphasis animations. Every object is shown in its final state.
  • Legacy .ppt files.

On this page