← Files RemotionARCHIVED FILE
skills/remotion-markup/motion-blur.md
1.92 KB · Oct 5, 2026 · 18:37 UTC
# Motion blur
Use `@remotion/motion-blur` for frame-driven motion blur.
Install it with `npx remotion add @remotion/motion-blur`.
`<HtmlInCanvasMotionBlur>` is the state of the art in Remotion for blurring animated HTML. It captures the content at fractional frames and averages its pixels in a canvas.
## `<HtmlInCanvasMotionBlur>`
Available from Remotion 4.0.529.
Supply the canvas `width` and `height`, usually from `useVideoConfig()`.
`shutterAngle` defaults to `180` and accepts `0` to `360`.
`0` disables blur. `samples` defaults to `8` and must be an integer from `1` to `64`. More samples can smooth the blur but increase preview and render cost.
Call `useCurrentFrame()` inside the child component so each sample receives its own frame.
```tsx
import {
HtmlInCanvasMotionBlur,
} from '@remotion/motion-blur';
import {useCurrentFrame, useVideoConfig} from 'remotion';
const MovingBox = () => {
const frame = useCurrentFrame();
return (
<div
style={{
position: 'absolute',
left: frame * 10,
top: 200,
width: 120,
height: 120,
backgroundColor: '#ff6b6b',
}}
/>
);
};
export const HtmlInCanvasBlur = () => {
const {width, height} = useVideoConfig();
return (
<HtmlInCanvasMotionBlur
width={width}
height={height}
samples={8}
shutterAngle={180}
>
<MovingBox />
</HtmlInCanvasMotionBlur>
);
};
```
For live preview, enable HTML-in-canvas in Chrome 149 or later with `chrome://flags/#canvas-draw-element`.
No configuration for rendering is necessary.
Do not nest `<HtmlInCanvas>` or `<HtmlInCanvasMotionBlur>` components; nested HTML-in-canvas is unsupported.
If HTML-in-canvas is unavailable, see the [motion blur guide](https://www.remotion.dev/docs/motion-blur) for other options. See the [`<HtmlInCanvasMotionBlur>` reference](https://www.remotion.dev/docs/motion-blur/html-in-canvas-motion-blur) for API details.
SHA-256: 5b5d975e75f5fa46532a5dfa1ec86ba6637ce3c48e8b518b562964883b3a80ff