Skip to content

Install

The package is ESM-only and ships its own TypeScript types. There is no CSS file to import — the component carries its styles inside its shadow root.

Terminal window
npm i fileon

A single module script is enough. This registers the elements and gives you a working viewer on a static page.

<script type="module" src="https://cdn.jsdelivr.net/npm/fileon/+esm"></script>
<file-preview src="/report.pdf" bordered></file-preview>

The entry is about 17 kB gzipped. Every viewer beyond that is a separate chunk loaded on first use, so a page that only ever previews images never downloads pdf.js, mammoth or JSZip.

Any browser with ES modules, custom elements and shadow DOM — so current Chrome, Edge, Firefox and Safari. There is no IE or legacy Edge support, and none is planned.