npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@s8fy/pptx-viewer-svelte

v3.1.0

Published

High-fidelity PPTX viewer actions and helpers for Svelte, powered by @s8fy/pptx-viewer

Readme

@s8fy/pptx-viewer-svelte

High-fidelity PowerPoint viewing in Svelte, powered by the shared PPTX viewer engine.

Svelte actions and imperative helpers for @s8fy/pptx-viewer, with font-driven text layout, vector graphics, charts, and supported DrawingML effects. Use the pptx action or mountViewer helper to manage the shared viewer controller.

Install

pnpm add @s8fy/pptx-viewer @s8fy/pptx-viewer-svelte svelte

@s8fy/pptx-viewer is a direct installation because the application imports its stylesheet.

Peer dependency: Svelte 5. The package declares Node.js 22.12+. It exports actions and imperative helpers, not a Svelte component.

Usage

<script lang="ts">
  import { pptx } from '@s8fy/pptx-viewer-svelte'
  import type { PptxActionParams } from '@s8fy/pptx-viewer-svelte'
  import '@s8fy/pptx-viewer/style.css'

  let { file }: { file: ArrayBuffer } = $props()
  function onError(error: Error) { console.error(error) }
  let options: PptxActionParams = $derived({
    source: { kind: 'file', file },
    onError,
  })
</script>

<div use:pptx={options}></div>

The pptx action reuses the controller for source changes and recreates it when configuration changes. The package also exports mountViewer() for component authors that prefer an imperative wrapper. Module import is SSR-safe, while invoking an action or helper requires a browser DOM node.

Action parameters and lifecycle

PptxActionParams extends ViewerOptions with onReady(viewer). onReady runs on creation/recreation, not after file loading; use onLoad({ total }) for document readiness. Other callbacks include onSlideChange(index), onLicenseStateChange(state), and onError(error).

Use await file.arrayBuffer() to prepare file bytes. A normalized model source is { kind: 'presentation', presentation }. Omitting source creates an empty viewer. Top-level file, fileName, and presentation options are rejected.

Keep source objects stable between unrelated updates. Replace a source/model reference when its contents change. Source removal or configuration changes recreate the controller; callback changes alone do not. Svelte calls the action's cleanup when its node is removed, so do not separately destroy that controller.

Imperative helper

import { mountViewer } from '@s8fy/pptx-viewer-svelte'
import '@s8fy/pptx-viewer/style.css'

export function mount(host: HTMLElement) {
  const mounted = mountViewer(host, { onError: console.error })
  // Later: await mounted.viewer.load(buffer, 'slides.pptx')
  // Apply a complete options object with mounted.update(options).
  return mounted
}

mountViewer returns { viewer, update(options?), destroy() }. viewer always reads the current controller; update returns that controller and replaces the complete options set rather than merging a patch. Call destroy() on disposal when using this helper directly.

Await imperative loads/exports and handle rejections. PDF/PPTX export requires an original file source. In SvelteKit, run imperative mounting in onMount; actions already run on the client. Shared rendering capabilities, defaults, font/asset settings, and methods are in the viewer README.

Upgrading to 3.0

  • The usePptx alias is removed: import pptx and change use:usePptx={options} to use:pptx={options}.
  • The createPptx alias is removed: call mountViewer(host, options) instead.
  • Controllers from onReady or mounted.viewer no longer have fullscreen(). Use await viewer.enterFullscreen() in a user interaction handler and handle its Promise<void> rejection; onError only notifies and does not consume the rejection.

The retained pptx action and mountViewer signatures are unchanged. Rendering, parsing, PDF export, and lifecycle behavior follow the shared Viewer 3.0.0 contract.

License

The default license is the PolyForm Noncommercial License. Commercial use requires a separate commercial license.