Skip to content

Component Props

<PowerPointViewer> follows the Vue binding's contract with two Svelte 5 conventions: events are callback props (onload, not @load), and the content prop is named source.

Props

PropTypeDefaultDescription
sourceUint8Array | ArrayBuffer | null-Raw .pptx bytes. Assigning a new value loads the new presentation in place.
themeViewerThemebuilt-in darkPartial palette / radius / raw CSS vars; see Theming.
localestring'en'UI locale (BCP 47). Register non-English dictionaries via pptx-svelte-viewer/i18n.
initialSlidenumber0Slide shown after load (0-based, clamped).
showThumbnailsbooleantrueShow the thumbnail sidebar.
showToolbarbooleantrueShow the navigation/zoom toolbar.
classstring''Extra class on the root element.

Event callbacks

PropSignatureFired when
onload(detail: { slideCount: number; canvasSize: CanvasSize }) => voidA presentation finishes loading.
onerror(message: string) => voidA load fails (message is human-readable).
onslidechange(index: number) => voidThe active slide changes (0-based).

Type exports

ts
import type {
	CanvasSize,
	PowerPointViewerProps,
	ViewerLoadDetail,
	ViewerTheme,
	ViewerThemeColors,
} from 'pptx-svelte-viewer';

Theme presets and helpers (vermilionLightTheme, vermilionDarkTheme, defaultThemeColors, defaultRadius, themeToCssVars, defaultCssVars) are re-exported from the package root; i18n helpers (registerTranslations, translate, keyToLabel, translationsEn, and the TranslationKey type) live under pptx-svelte-viewer/i18n.

Released under the Apache-2.0 License.