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.
npm i fileonpnpm add fileonyarn add fileonbun add fileonWithout a bundler
Section titled “Without a bundler”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>What gets downloaded
Section titled “What gets downloaded”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.
Browser support
Section titled “Browser support”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.