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.
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.
Controller
| State | For a presentation |
|---|---|
pageKind, page, pageCount | 'slide', the slide most in view, and the number of slides. Hidden slides are shown, marked as hidden. |
zoom, scale | Every zoom works; 'fit-page' shows one whole slide at a time. |
rotation | Not supported. |
outline | The slide titles, one entry per slide, when the slides have titles. |
thumbnails | One per slide, drawn from the slide itself. |
search.count | Matches in slide text, tables, SmartArt and shapes. |
can | zoom, fit, search, print, download, sidebar. |
Things to know:
toggleFullscreen()shows the deck full screen; with'fit-page'zoom each slide fills the screen, andnext()andprev()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:
'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 '@anypreview/react';
import '@anypreview/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>
);
}Not yet
- Entrance and emphasis animations. Every object is shown in its final state.
- Legacy
.pptfiles.
Excel (XLSX)
Show Excel workbooks (XLSX, XLSM, XLTX) in React with sheet tabs, formatting, merges, frozen panes, charts, comments and conditional formatting. Windowed for 100,000-row sheets.
Show PDF files in React with pdf.js in a Web Worker, selectable text, search, bookmarks, password prompts and smooth scrolling through 1,000-page documents.