Search Docs
Loading...
Skip to content

Design Viewer

Lightweight design viewing for your web app—pan, zoom, and navigate multi-page designs. Runs entirely in the browser with no server dependencies.

Viewer starter kit showing a lightweight content display interface

5 mins
estimated time
Download
StackBlitz
GitHub

Pre-requisites#

This guide assumes basic familiarity with JavaScript or TypeScript.

  • Node.js v22+ with npm – Download
  • Supported browsers – Chrome 114+, Edge 114+, Firefox 115+, Safari 15.6+
    See Browser Support for the full list

Get Started#

Start fresh with a standalone Design Viewer project. This creates a complete, ready-to-run application.

Step 1: Clone the Repository#

Terminal
git clone https://github.com/imgly/starterkit-design-viewer-ts-web.git
git clone https://github.com/imgly/starterkit-design-viewer-ts-web.git

The src/ folder contains the viewer code:

src/
├── index.ts # Application entry point
└── imgly/
├── index.ts # Viewer initialization function
├── demo-assets.ts # Demo asset URLs
└── config/
├── plugin.ts # Main configuration plugin
├── actions.ts # Export/import actions
├── features.ts # Feature toggles
├── i18n.ts # Translations
├── settings.ts # Engine settings
├── keyboard/ # Keyboard shortcuts
│ ├── keyboard.ts # Shortcut registration
│ └── catalogs/
│ └── us-ansi.ts # Key catalog
└── ui/ # UI customization
├── index.ts # Combines UI customization exports
├── canvas.ts # Canvas configuration
├── components.ts # Custom component registration
├── dock.ts # Dock layout configuration
├── inspectorBar.ts # Inspector bar layout
├── navigationBar.ts # Navigation bar layout
├── panel.ts # Panel configuration
└── videoTimeline.ts # Timeline configuration

Step 2: Install Dependencies#

Terminal
cd starterkit-design-viewer-ts-web
npm install
cd starterkit-design-viewer-ts-web
npm install

Step 3: Download Assets#

CE.SDK requires engine assets (fonts, icons, UI elements) to function. For production, serve them as static files from your project’s public/ directory.

Terminal
curl -O https://cdn.img.ly/packages/imgly/cesdk-js/1.87.0-rc.3/imgly-assets.zip
unzip imgly-assets.zip -d public/
rm imgly-assets.zip
curl -O https://cdn.img.ly/packages/imgly/cesdk-js/1.87.0-rc.3/imgly-assets.zip
unzip imgly-assets.zip -d public/
rm imgly-assets.zip

Without further setup, the editor loads these assets from the IMG.LY CDN, which is for development only. To use the downloaded copy, set baseURL: '/assets' in the editor configuration in src/index.ts. To add your license key, add one of the two license lines below to the same object, without the leading //. Option 1 puts the key in the code. Option 2 reads VITE_CESDK_LICENSE from a .env file, which you create as a copy of .env.example. Without a license key, the editor runs in evaluation mode and adds a watermark to exports.

src/index.ts
const config = {
// ...
baseURL: '/assets',
// license: 'YOUR_CESDK_LICENSE_KEY' // Option 1: the key in the code
// license: import.meta.env.VITE_CESDK_LICENSE // Option 2: the key from .env
// ...
};

Step 4: Run the Development Server#

Terminal
npm run dev
npm run dev

Open http://localhost:5173 in your browser.

Set Up a Scene#

CE.SDK offers multiple ways to load content into the viewer. Choose the method that matches your use case:

src/index.ts
// Load from a template archive - loads a previously saved project
await cesdk.load('https://example.com/design.zip');
// Load from a scene file - restores a saved scene
await cesdk.load('https://example.com/scene.scene');
// Zoom to fit the content
await cesdk.actions.run('zoom.toPage', {
page: 'first',
autoFit: true,
padding: 24
});

Customize (Optional)#

Theming#

CE.SDK supports light and dark themes out of the box, plus automatic system preference detection. Switch between themes programmatically:

src/imgly/index.ts
// 'light' | 'dark' | 'system' | (() => 'light' | 'dark')
cesdk.ui.setTheme('dark');

See Theming for custom color schemes, CSS variables, and advanced styling options.

Localization#

Customize UI labels and add support for multiple languages. The i18n system supports translation keys for all UI elements:

src/imgly/config/i18n.ts
// Override specific labels
cesdk.i18n.setTranslations({
en: {
'component.zoom.in': 'Zoom In',
'component.zoom.out': 'Zoom Out'
}
});
// Add a new language
cesdk.i18n.setTranslations({
de: {
'component.zoom.in': 'Vergrößern'
}
});
// Set the active locale
cesdk.i18n.setLocale('de');

See Localization for supported languages, translation key reference, and right-to-left language support.


Key Capabilities#

The Design Viewer includes everything needed for design viewing.

Pan & Zoom

Pan & Zoom

Navigate designs with intuitive pan and zoom controls.

Page Navigation

Page Navigation

Navigate between pages in multi-page designs and presentations.

Zoom Controls

Zoom Controls

Zoom in and out of the canvas with fit-to-screen options.

Read-Only Mode

Read-Only Mode

Display design content without editing capabilities for preview and approval workflows.

Approval Workflows

Approval Workflows

Review and approve designs without the risk of accidental modifications.

Lightweight Interface

Lightweight Interface

Minimal UI focused on viewing experience without editing distractions.



Troubleshooting#

Viewer doesn’t load#

  • Check the container element exists: Ensure your container element is in the DOM before calling create()
  • Verify the baseURL: Assets must be accessible from the CDN or your self-hosted location
  • Check console errors: Look for CORS or network errors in browser developer tools

Content doesn’t appear#

  • Check network requests: Open DevTools Network tab and look for failed requests to cdn.img.ly
  • Self-host assets for production: See Serve Assets to host assets on your infrastructure

Watermark appears in production#


Next Steps#