DocsSvelteHeadlessIntroduction

Headless Components

EmbedPDF Svelte’s headless library is an unopinionated UI toolkit for building fully customized PDF experiences.

Unlike the Drop-in Viewer which gives you a pre-built interface, the headless library provides the logic (stores) and rendering primitives (components) but zero styling. You are responsible for building the UI—toolbars, buttons, and layout.

Core Concepts

  1. You Control the UI: We provide the logic, you provide the pixels. Use your own button components, your own CSS (Tailwind, scoped styles, etc.), and your own layout.
  2. Composable by Design: Build your viewer by composing specialized components (<RenderLayer />, <Scroller />) and stores (useSearch, useSelection).
  3. Minimal Bundle Size: Import only the plugins you need. If you don’t need annotations, don’t import the plugin.

When to Use

Choose Headless Components if:

  • You need to match your application’s design system exactly.
  • You are building a specialized viewer (e.g., review, or split-pane layouts).
  • You want to integrate PDF features into an existing UI workflow.
  • You need the smallest possible bundle size.

Comparison

FeatureDrop-in ViewerHeadless Components
Setup TimeMinutesHours
UI CustomizationTheme colors, toggle features100% Control
Bundle SizeLarger (includes full UI)Minimal (tree-shakeable)
Best ForStandard viewingCustom apps & design systems

Ready to build? Start your custom viewer.

Last updated on December 22, 2025

Need Help?

Join our community for support, discussions, and to contribute to EmbedPDF's development.