Component Inputs & Outputs
For custom host sizing, see Viewport fitting for fitPadding, maxFitScale, framework-specific examples, and default values.
PowerPointViewerComponent (selector pptx-viewer) exposes its configuration through signal-based input()s and events through output()s. Only content is meaningful for a read-only viewer; everything else is optional. This reference is taken directly from the source component.
import { PowerPointViewerComponent } from 'pptx-angular-viewer';TIP
Angular has no forwardRef handle: PowerPointViewerComponent's public methods (navigation, undo/redo, zoom, getContent(), ...) live directly on the component instance, reachable via a template reference variable or viewChild(). See Public API.
Content
| Input | Type | Default | Description |
|---|---|---|---|
content | Uint8Array | ArrayBuffer | null | null | Raw .pptx file bytes. Accepts either typed array or ArrayBuffer directly - no manual wrapping. |
filePath | string | undefined | - | Original file path or name. Keys autosave recovery in IndexedDB and shows in the title bar. |
fileName | string | undefined | - | Display name shown in the title bar next to the save-location status. Falls back to a localised "Presentation". |
Autosave recovery requires filePath
The viewer's built-in autosave serializes the document to IndexedDB keyed by filePath. Without a stable filePath across reloads, recovery has no key to look up.
Autosave
| Input | Type | Default | Description |
|---|---|---|---|
autosave | boolean | undefined | true | Recovery autosave. A policy ceiling over the title-bar toggle; see below. |
autosaveIntervalMs | number | undefined | File > Options cadence | Recovery cadence. An explicit value outranks the user's AutoRecover setting. |
storage | DocumentStorage | undefined | none | Host-owned storage: Save goes to storage.save(), recovery copies to its recovery methods. See Host-owned storage. |
readOnly | boolean | false | Makes the deck read-only. true wins over canEdit; false only lifts this restriction. |
fileProviders | readonly CloudFileProvider[] | undefined | - | Cloud places for File > Open (for example OneDrive). A file opened from one saves back to that place instead of storage. |
The rule is the same in all five bindings and lives in one shared decision function, resolveAutosaveActivation:
The
autosaveinput is a policy ceiling. The title-bar AutoSave toggle is the user's preference inside it.
autosave | What runs | The toggle |
|---|---|---|
| omitted | Autosave runs; the user's toggle decides, defaulting to on. | Works. |
true | Same as omitted: the host permits it, the user decides. | Works. |
false | Autosave is off, and no recovery prompt is offered on load. | Inert (it must not move). |
A preference can never exceed a policy, which is why autosave="false" also takes the switch away. canEdit and a filePath key remain hard requirements either way, and an explicit autosaveIntervalMs outranks the user's File > Options > Save > "Save AutoRecover information every N minutes" cadence (two minutes by default).
When a deck finishes loading and a snapshot newer than 24 hours exists for the same filePath, the viewer raises a "Recover unsaved changes?" dialog offering Restore or Discard.
Editing
| Input | Type | Default | Description |
|---|---|---|---|
canEdit | boolean | false | Enables editing actions (ribbon editing tools, inspector edits, inline text editing, slide management). false is read-only. |
Display
These match the Svelte and vanilla bindings; the defaults and clamping are shared.
| Prop | Type | Default | Description |
|---|---|---|---|
[initialSlide] | number | 0 | Zero-based slide shown after each load, clamped into the deck. Changing it later applies to the next load, not the current slide. |
[googleFonts] | false | { baseUrl: string } | unset | Google Fonts fallback for deck fonts that are neither installed nor embedded. Unset leaves it to File > Options > Trust Center > "Download fonts that are not installed or embedded" (on by default: loads them from fonts.googleapis.com); false sends no request to Google (text uses installed, embedded or fallback fonts) and locks that option off; { baseUrl } sends the CSS2 request to a self-hosted mirror instead and locks it on (an invalid baseUrl turns the fallback off and locks it off). See Fonts and privacy. |
[allowExternalContent] | boolean | unset | Host switch for content a deck links from another server (http(s) targets): pictures, picture fills and bullets, video, audio and poster frames. Unset follows PowerPoint: nothing is fetched when a deck opens and a security bar offers Enable Content for that presentation, unless the user turned on File > Options > Trust Center > "Allow external content" (off by default). false fetches none of it and shows no bar, true fetches it without asking; either value locks the Trust Center option to match. Enable Content and a change of this value redraw the slides at once: nothing reloads, and unsaved edits and undo history are kept. Google Fonts requests are separate (googleFonts). See External content and privacy. |
[listConversionScope] | 'paragraph' | 'list' | 'paragraph' | How far Bullets / Numbering reach from a bare caret. 'paragraph' converts only the caret's paragraph, as in PowerPoint. 'list' makes a caret that switches a list paragraph between bullets and numbering convert the whole list around it (adjacent items at its level and the deeper items nested between them), as in Word and Google Docs. Turning a list off, listing a plain paragraph and range selections are the same in both modes. |
[limits] | PptxLoadLimits | unset | Bounds on loading a deck, for hosts that show untrusted decks: maxInputBytes, maxUncompressedBytes, maxEntries, maxSlides, maxShapes. Unset keeps the core defaults (500 MiB inflated, 65,536 ZIP entries, nothing else bounded). A deck over a limit shows the load-error screen with the limit and the deck's value. A change applies from the next load. See Load limits. |
[showToolbar] | boolean | true | Show the editor chrome: title bar, ribbon and toolbar, protected-view and read-only banners, the mobile toolbar and the status bar. false leaves the canvas (and the thumbnail pane, if shown). |
[ribbonDisplay] | 'always' | 'tabs' | 'fullScreen' | 'always' | PowerPoint's Ribbon Display Options: 'always' docks tabs and commands, 'tabs' shows the tab row and lays a tab's commands over the slide when it is chosen, 'fullScreen' hides the title bar and the ribbon behind a strip at the top. The user changes it from the menu at the right end of the tab row, with Ctrl+F1 or a double click on a tab; changing the value from the host switches the mode. |
[showThumbnails] | boolean | true | Show the slide thumbnail pane. It still follows the user's own collapse toggle and the slidesPane customisation panel. |
[showCompatibilityToasts] | boolean | true | Show the compatibility warning toast stack after a load. false hides the stack only; the warnings are still collected. Independent of showToolbar. |
<pptx-viewer [content]="bytes" [initialSlide]="2" [showToolbar]="false" [showThumbnails]="false" />Events (@Output()s)
| Output | Payload | Description |
|---|---|---|
dirtyChange | boolean | Fires when the unsaved-changes flag toggles. |
contentChange | Uint8Array | Fires with the re-serialized document bytes whenever getContent() materialises the deck. |
activeSlideChange | number | Fires when the active slide changes. |
modeChange | string | Fires when the viewer mode changes: 'preview', 'edit', 'present', or 'master'. |
zoomChange | number | Fires when the zoom level changes. |
ribbonDisplayChange | 'always' | 'tabs' | 'fullScreen' | Fires when the user picks a Ribbon Display Options mode. Not fired when the host changes the value. The viewer keeps the choice for its own lifetime only; store it to bring it back on the next visit. |
onElementRenderError (input) | (error: Error, context: ElementRenderErrorContext) => void | An input, like onHyperlinkClick, so its absence keeps the default. A slide element was omitted because its renderer threw; context is { elementId, elementType, slideId }. Only that element is left out, on every surface. Defaults to console.error(error, context), also used when the callback throws. |
selectionChange | string[] | Fires when element selection changes. |
slideCountChange | number | Fires when the total slide count changes (slide added/deleted). |
propertiesChange | Partial<PptxCoreProperties> | Fires when the user (or the AI assistant) changes document properties (Info dialog, inspector). |
documentChange | void | Fires after any committed document edit (move, resize, text, undo, redo, ...). Not named change: that would also catch the native change events of inputs inside the viewer. |
autosaved | Uint8Array | Fires with the serialised deck each time a recovery autosave snapshot is written. Not named autosave: the autosave input owns that name. |
autosaveToggle | boolean | Fires when the user enables or disables autosave (title bar or File > Options). |
autosaveStatus | 'idle' | 'saving' | 'saved' | 'error' | Fires on every autosave lifecycle transition. |
autosaveRecovery | AutosaveRecord | Fires when a recovery snapshot left by a previous session is found. The built-in recovery prompt is shown as well. |
notesUpdate | string | Fires with the new speaker-notes text after a notes edit. |
presentationChange | boolean | Fires when presentation (slide show) mode is entered or left. |
collaborationStatus | ConnectionStatus | Fires on every collaboration connection-status transition. |
startCollaboration | CollaborationConfig | Fires when a session starts from the Share/Broadcast dialog. Set the collaboration input in response. |
stopCollaboration | void | Fires when the session stops from the Share/Broadcast dialog. Clear the collaboration input in response. |
collaborationChange | CollaborationState | Fires when a session starts or stops, and when its status, synced flag or people change. |
load | ViewerLoadDetail | Fires each time a presentation finishes loading without an error (slideCount, canvasSize). |
error | string | Fires once per distinct load failure, with a human-readable message. |
INFO
contentChange delivers a Uint8Array, not a boolean. To pull content on demand instead, call getContent() on the component instance.
Presentation / authoring
| Input | Type | Default | Description |
|---|---|---|---|
authorName | string | undefined | - | Display name used as the author for comments/annotations and as the broadcast owner's name. Falls back to collaboration.userName or 'You'/'Presenter'. |
class | string | '' | Optional class name applied to the viewer's root element. |
smartArt3D | boolean | false | Opt in to the Three.js SmartArt renderer (extruded 3D blocks on WebGL). Requires the optional three peer; falls back to SVG without it. |
surfaceChart3D, barChart3D, lineChart3D, areaChart3D, pieChart3D | boolean | false | Independently opt in to interactive Three.js renderers for the matching 3D chart kinds. Each falls back to SVG when three is unavailable or the chart cannot render as a WebGL scene. |
ai | PptxAiAssistant | PptxAiConfig | - | Enables the optional AI assistant: pass createAiAssistant(config) from pptx-angular-viewer/ai, or a plain PptxAiConfig. Its SDK peer loads only when the panel is opened; omit this input to leave the assistant unavailable. |
onOpenFile | (() => void) | undefined | - | Host override for the File ▸ Open action: bypasses the built-in native file picker; the host then supplies a new content value instead. |
onHyperlinkClick | HyperlinkClickHandler | - | Function input (not an output). Called before following a link; return false to cancel the default action. |
ribbonAddIns | readonly RibbonAddInTab[] | undefined | - | Ribbon tabs the host adds after Help. Each command runs its run callback and dispatches a bubbling office-ribbon-add-in event. Desktop ribbon only. |
inspectorInitiallyOpen | boolean | undefined | - | Initial inspector visibility; omitted keeps the desktop/mobile default. |
fonts | ViewerFontSource[] | [] | Licensed font sources supplied by the host. No fonts are bundled. |
hiddenActions | ToolbarActionId[] | [] | Individual toolbar buttons and/or ribbon tabs to hide. Unioned with customization. |
Theming
| Input | Type | Default | Description |
|---|---|---|---|
theme | ViewerTheme | undefined | - | Theme configuration: partial color overrides, a custom radius, and arbitrary cssVars. Unset values fall back to the built-in dark theme. See Theming. |
<pptx-viewer
[content]="bytes"
[theme]="{ colors: { primary: '#6366f1', background: '#0f172a' }, radius: '0.75rem' }"
/>Theme, language and account
| Input | Type | Description |
|---|---|---|
defaultThemeKey | string | undefined | Initial theme key for File > Options > Theme. |
availableThemes | readonly ThemeCatalogEntry[] | undefined | Theme choices offered by File > Options. |
onThemeChange | ((key: string) => void) | undefined | Function input. Called when the user picks a theme; the host then owns persisting the choice. |
defaultLocale | string | undefined | Initial locale code for File > Options > Language. |
availableLocales | readonly LocaleCatalogEntry[] | undefined | Locale choices offered by File > Options > Language. |
onLocaleChange | ((code: string) => void) | undefined | Function input. Called when the user picks a language; the host then owns applying and persisting it. |
accountAuth | AccountAuthConfig | undefined | Hook point for File > Account's sign-in section; disabled by default. |
UI customization
| Input | Type | Default | Description |
|---|---|---|---|
[customization] | ViewerCustomization | - | Hide, lock or remap any part of the chrome: ribbon tabs and buttons, File > Options pages, sections and settings (lock a value, set a default), File tab pages and cards, context-menu entries, editor shortcuts, panels, features (AI, collaboration) and dialogs. Unioned with hiddenActions. A new object replaces the whole customisation. |
<pptx-viewer [content]="bytes" [canEdit]="true" [customization]="customization" />The same helpers (hideRibbonTab, lockSetting, remapShortcut, ...) are available on the component instance to change it at runtime; see the API page. Every id, the rules and recipes are in the UI Customization guide.
Collaboration
These inputs enable and control real-time co-editing. See Collaboration for the full flow and the CollaborationConfig shape.
| Input | Type | Default | Description |
|---|---|---|---|
collaboration | CollaborationInput | undefined | - | When provided, enables collaborative editing with live cursors, presence, and Yjs CRDT sync. Takes the legacy CollaborationConfig or the shared CollaborationOptions. Requires the yjs peer plus y-websocket or y-webrtc. |
shareDefaults | { roomId?: string; userName?: string; serverUrl?: string } | undefined | - | Default values for the Share/Broadcast dialog fields. If omitted, the fields start empty (userName falls back to authorName). |
INFO
collaboration is controlled, same as React/Vue. The viewer does not start a session on its own - listen for startCollaboration to set the input, and stopCollaboration to clear it.
Full input/output list
class PowerPointViewerComponent {
// Inputs
readonly content = input<Uint8Array | ArrayBuffer | null>(null);
readonly canEdit = input<boolean>(false);
readonly initialSlide = input<number | undefined>(undefined);
readonly googleFonts = input<false | { baseUrl: string } | undefined>(undefined);
readonly allowExternalContent = input<boolean | undefined>(undefined);
readonly listConversionScope = input<'paragraph' | 'list' | undefined>(undefined);
readonly limits = input<PptxLoadLimits | undefined>(undefined);
readonly showToolbar = input<boolean | undefined>(undefined);
readonly ribbonDisplay = input<'always' | 'tabs' | 'fullScreen' | undefined>(undefined);
readonly showThumbnails = input<boolean | undefined>(undefined);
readonly showCompatibilityToasts = input<boolean | undefined>(undefined);
readonly class = input<string>('');
readonly theme = input<ViewerTheme | undefined>(undefined);
readonly filePath = input<string | undefined>(undefined);
readonly fileName = input<string | undefined>(undefined);
readonly collaboration = input<CollaborationInput | undefined>(undefined);
readonly authorName = input<string>();
readonly shareDefaults = input<
{ roomId?: string; userName?: string; serverUrl?: string } | undefined
>(undefined);
readonly onOpenFile = input<(() => void) | undefined>(undefined);
readonly smartArt3D = input<boolean>(false);
readonly surfaceChart3D = input<boolean>(false);
readonly barChart3D = input<boolean>(false);
readonly lineChart3D = input<boolean>(false);
readonly areaChart3D = input<boolean>(false);
readonly pieChart3D = input<boolean>(false);
readonly ai = input<PptxAiConfig | undefined>(undefined);
readonly onHyperlinkClick = input<HyperlinkClickHandler>();
readonly ribbonAddIns = input<readonly RibbonAddInTab[] | undefined>(undefined);
readonly inspectorInitiallyOpen = input<boolean | undefined>(undefined);
readonly defaultThemeKey = input<string | undefined>(undefined);
readonly availableThemes = input<readonly ThemeCatalogEntry[] | undefined>(undefined);
readonly onThemeChange = input<((key: string) => void) | undefined>(undefined);
readonly defaultLocale = input<string | undefined>(undefined);
readonly availableLocales = input<readonly LocaleCatalogEntry[] | undefined>(undefined);
readonly onLocaleChange = input<((code: string) => void) | undefined>(undefined);
readonly accountAuth = input<AccountAuthConfig | undefined>(undefined);
// Outputs
readonly activeSlideChange = output<number>();
readonly dirtyChange = output<boolean>();
readonly contentChange = output<Uint8Array>();
readonly propertiesChange = output<Partial<PptxCoreProperties>>();
readonly documentChange = output<void>();
readonly autosaved = output<Uint8Array>();
readonly autosaveToggle = output<boolean>();
readonly autosaveStatus = output<'idle' | 'saving' | 'saved' | 'error'>();
readonly autosaveRecovery = output<AutosaveRecord>();
readonly notesUpdate = output<string>();
readonly presentationChange = output<boolean>();
readonly collaborationStatus = output<ConnectionStatus>();
readonly modeChange = output<string>();
readonly zoomChange = output<number>();
readonly ribbonDisplayChange = output<'always' | 'tabs' | 'fullScreen'>();
readonly selectionChange = output<string[]>();
readonly slideCountChange = output<number>();
readonly startCollaboration = output<CollaborationConfig>();
readonly stopCollaboration = output<void>();
readonly collaborationChange = output<CollaborationState>();
readonly load = output<ViewerLoadDetail>();
readonly error = output<string>();
}Notes on triggering features
Navigation, mode-switching, zoom, undo/redo, and selection are available through the public API (viewer.goNext(), viewer.setMode('present'), etc.). Export and print are driven through the built-in ribbon/dialogs. See Export for details on document export.