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

@cobuildx.ai/office-viewer

v0.1.5

Published

Renders .pptx and .docx files in the browser, with optional React bindings

Downloads

909

Readme

@cobuildx.ai/office-viewer

Renders .pptx and .docx files directly in the browser — no server-side conversion, no PDF, no LibreOffice. Parses the OOXML package and paints slides/pages straight to the DOM.

  • Framework-agnostic core at the package root — usable from plain JS, Vue, Svelte, etc.
  • React bindings at @cobuildx.ai/office-viewer/react — components and hooks. React is an optional peer dependency: if you never import the /react entry, your bundle never sees React.

Install

npm install @cobuildx.ai/office-viewer

React bindings additionally require react and react-dom (>=18) in your project.

React usage

import { PptxViewer } from '@cobuildx.ai/office-viewer/react';

function Slide({ file }: { file: File }) {
  return <PptxViewer src={file} style={{ height: '100vh' }} />;
}
import { DocxViewer } from '@cobuildx.ai/office-viewer/react';

function Doc({ file }: { file: File }) {
  return <DocxViewer src={file} style={{ height: '100vh' }} />;
}

src accepts a File, ArrayBuffer, or Uint8Array.

Components

<PptxViewer src toolbar? className? style? onLoad? onError? onSlideChange? /> Renders a .pptx deck with built-in prev/next navigation. Pass a ref to get { next(), prev(), goTo(index), deck }.

<DocxViewer src toolbar? className? style? onLoad? onError? onPageChange? /> Renders a .docx document, paginated, with a thumbnail strip. Pass a ref to get { next(), prev(), goTo(index), doc }.

Hooks

If you want to drive your own UI instead of the built-in components:

import { useDeck } from '@cobuildx.ai/office-viewer/react';

const { deck, loading, error } = useDeck(file); // re-loads on `file` change, disposes on unmount

useDocument(src) is the .docx equivalent, returning { doc, loading, error }.

Framework-agnostic usage

import { loadPptx, createViewer } from '@cobuildx.ai/office-viewer';

const deck = loadPptx(arrayBuffer);
const viewer = createViewer(deck, containerEl, { fit: 'contain' });
viewer.next();
viewer.goTo(3);
// when done:
viewer.destroy();
deck.dispose();
import { loadDocx, createDocxViewer } from '@cobuildx.ai/office-viewer';

const doc = loadDocx(arrayBuffer);
const viewer = createDocxViewer(doc, containerEl, { fit: 'width' });
viewer.next();
viewer.goTo(2);
// when done:
viewer.destroy();
doc.dispose();

Always call dispose() on the deck/document when you're done with it — it revokes object URLs created for embedded media.

What's supported

Both formats are read-only viewers.

  • PPTX: ~106 preset shapes, charts, tables, pictures, text with autofit, gradients (including radial focus/path gradients); SmartArt is not yet laid out (data model only).
  • DOCX: paragraphs, runs, tables (styles + conditional formatting), images, numbering/lists, styles, headers/footers, section-aware pagination.

Package layout

| Export | Contents | |---|---| | @cobuildx.ai/office-viewer | Deck/document loading, viewers, renderers, and low-level OOXML building blocks (OpcPackage, XML helpers) — no React dependency. | | @cobuildx.ai/office-viewer/react | PptxViewer, DocxViewer, useDeck, useDocument. |