π¬βTransform Mode
How do I zoom and pan across one big canvas instead of cutting between slides?
TransformSlide puts content on a plane and moves a camera between positions
instead of cutting between slides. One canvas, many framings.
import { TransformSlide, type TransformSubSlide } from "@getnarro/core";
const steps: TransformSubSlide[] = [
{
content: <Heading level={1}>The whole system</Heading>,
position: { x: 0, y: 0, scale: 1 },
},
{
content: <Text>Zoom into ingestion</Text>,
position: { x: 100, y: 0, scale: 0.8, rotate: -5 },
},
{
content: <Text>And into storage</Text>,
position: { x: 50, y: 80, scale: 1.2, rotate: 5 },
},
];
<Slide id="tour">
<TransformSlide subSlides={steps} duration={1} easing="backInOut" />
</Slide>;
| Prop | Type | Default |
|---|---|---|
subSlides | TransformSubSlide[] | required |
duration | number (seconds) | 1 |
easing | easing name | easeInOut |
perspective | boolean | false |
perspectiveValue | number (px) | 1000 |
initialSubSlide | number | 0 |
duration is seconds, not milliseconds. Every duration in @getnarro/core is;
@getnarro/shared-ui uses milliseconds, and that split is the sharpest edge in the
library β see Limitations. duration={1000}
is not a one-second flight, it is a sixteen-minute one, and it renders as a camera that
never appears to move. A duration above 30 warns in development for exactly this reason.
perspective is off unless you ask for it. It only matters if your positions use z,
and turning it on promotes the whole camera subtree to a GPU texture β which is what
makes scaled text blurry.
Each position is { x, y, scale, rotate? }, where x and y are offsets
from the canvas origin and scale is the cameraβs zoom.
Navigation
Sub-slides are navigation steps, like fragments: β moves to the next position
and only advances past the last one to the next slide. β walks back the same way,
Home and End jump to the first and last position, and Ctrl/Cmd with an arrow
skips the whole slide. The presenter does not have to think about the distinction.
Only the active slide listens, so a transform slide three slides away never steals a keypress.
When it earns its keep
Transform mode is the right call when the spatial relationship is the content β a system diagram you tour, a map, a timeline that reads as one long line, a zoom from summary into detail and back out.
It is the wrong call for a normal talk. Constant camera movement is tiring to watch and disorienting on a large screen, and audiences lose the thread when they cannot tell where they are. If the connection between two slides is logical rather than spatial, a cut says it better than a swoop.
A good compromise: normal slides for most of the deck, one transform slide for the part that genuinely benefits.
Motion sickness
Large scale changes and rotation are the parts that make people uncomfortable.
Keep scale within roughly 0.5β2, use rotate sparingly, and keep duration
under about 1200ms β a slow swoop is worse than a quick one.