# Svelte Integration
Native Svelte Component

The Svelte package provides both a native component and an action. Use the component for declarative pages and the action for existing DOM containers.

## Install Use the standard package when you want a light entry plus an explicit preset: ```bash npm install @file-viewer/svelte @file-viewer/preset-office ``` Use the full package when you want the complete matrix by default: ```bash npm install @file-viewer/svelte-full ``` `@file-viewer/svelte-full` enables `@file-viewer/preset-all` automatically while keeping the same component, action, event, and controller APIs. ## Component Usage ```svelte
``` The full package only changes the import: ```svelte
``` ## Action Usage For pages that do not want a component instance, mount the action on any existing container: ```svelte
``` ## Vite Auto Assembly SvelteKit / Vite projects can register the plugin so installed presets activate automatically and Worker / WASM / font / vendor assets are copied: ```bash npm install -D @file-viewer/vite-plugin ``` ```ts import { fileViewerRenderers } from '@file-viewer/vite-plugin' export default { plugins: [ fileViewerRenderers({ copyAssets: true }) ] } ``` Non-Vite projects can keep using `options.preset` / `options.renderers` explicitly.