# Zumly > JavaScript library for hierarchical zoom navigation (ZUI). Navigate in Z (depth) through discrete views in the XY plane with spatial transitions. ## What it is Zumly is a structured, trigger-driven zoom user interface engine. Users zoom into focused elements to open the next view — attention (focus) and depth (Z) stay aligned with layout (XY). It is NOT a freeform pan/zoom canvas or map library. - Framework-agnostic: works with React, Vue, Svelte, Angular, or plain HTML - Pluggable transition drivers: CSS, WAAPI, Anime.js, GSAP, Motion, none, or custom - Plugin system with hash router included - Touch, keyboard, mouse, and wheel input support ## How it works Each screen is a view, written by hand as HTML and CSS. Some elements in a view are triggers. Clicking one scales the current view until the trigger fills the canvas, and the next view grows out of that spot; the parent stays behind, dimmed. Zoom-out is the same transform in reverse. Siblings slide sideways. The zoom reads as continuous when the trigger and its view share a shape. Duration, ease, cover side (width/height), background effects and the animation driver can be set per instance or per trigger (`data-with-*`). ## Key concepts - **Canvas**: Container element with class `zumly-canvas` where views render - **View**: A DOM subtree with root class `z-view`. Sources: HTML strings, URLs, async functions, objects with `render()`, web components. Function views get `ctx.target` (the view itself), `props`, `onCleanup`, and `onActivate` (repaint when the view becomes current again) - **Trigger**: Element with class `zoom-me` and `data-to="viewName"` that initiates zoom-in - **Depth navigation**: Zoom in/out through view hierarchy (Z axis) - **Lateral navigation**: Navigate between sibling views at the same depth level. Triggers that share a view and differ in their data (`data-to="room" data-id="kitchen"`) are separate siblings. Each level keeps its own lateral history; `back()` undoes lateral moves before zooming out - **Driver**: Pluggable animation engine for transitions - **Plugin**: Object with `install(instance, options)` or plain function - **Events**: `viewChanged` fires after every navigation with `{ type, viewName, from, zoomLevel, node }` - **Back button** (`depthNav`): styles `'button'`, `'title'` (title of the view above) or `'rings'` (a ring per level, bands to jump several). Views name themselves with `title` or `data-title` - **Gestures**: `gestures: { follow: true }` makes trackpad, swipe and pinch (`inputs.pinch`) drive the zoom-out with their progress (`zoomOutProgress` event); `zoomOut(2)` / `zoomOut({ to })` climb several levels in one transition - **Rasterize**: `rasterize: { snapdom, stream }` shows views behind as a SnapDOM photo, for smooth zooms with heavy views. With SnapDOM's `stream` plugin the photo follows the view, so a zoom starts from what is on screen; a view whose photo would cost too much to keep current, light views and `data-rasterize="false"` stay live. SnapDOM and its plugins are optional peer dependencies - **WebGL**: `webgl: { snapdom, stream }` (rasterize included) draws zooms in a WebGL canvas and keeps the views behind as textures, with effects in a shader (custom ones in GLSL). `hover: true` prepares a view while the pointer rests on its trigger; `ancestors` (on by default) keeps everything behind past the third level as one picture. For heavy views on weak GPUs. - **Diagnostics**: the console explains typos in view names and options, and a canvas without size ## Quick start ```html
``` ## Links - Site: https://zumerlab.com/zumly/ - Showcases: https://zumerlab.com/zumly/#/home/showcases - GitHub: https://github.com/zumerlab/zumly - npm: https://www.npmjs.com/package/zumly - Full LLM reference: https://zumerlab.com/zumly/llms-full.txt - Learn in six steps (each with a runnable single-file example): https://zumerlab.com/zumly/learn/ - API reference: https://zumerlab.com/zumly/api.html - Playground (every visible option on one live example): https://zumerlab.com/zumly/guides/playground.html - Heavy views (rasterize and WebGL, with SnapDOM): https://zumerlab.com/zumly/guides/heavy-views.html - Architecture (the library explored with itself: layers, files, flows, options, API): https://zumerlab.com/zumly/guides/architecture.html - Driver API: https://github.com/zumerlab/zumly/blob/main/docs/DRIVER_API.md - TypeScript types: https://github.com/zumerlab/zumly/blob/main/types/zumly.d.ts ## Ecosystem - [Orbit](https://zumerlab.com/orbit/) — Radial layouts; satellites work as Zumly triggers. Guide: https://zumerlab.com/zumly/integrations/orbit-css.html - [SnapDOM](https://github.com/zumerlab/snapdom) — Fast DOM-to-image capture library