Skip to main content

zigzag()v4.0.471

Part of the @remotion/effects package.

Adds repeating zig-zag bands to canvas-based components such as <Video>, <HtmlInCanvas> and <Solid>.

It uses the same band controls as lines(), and the same displacement controls as waves(), but uses sharp triangular turns.

Preview​

Drag current effect onto a layer in the Studio

Example​

MyComp.tsx
import {zigzag} from '@remotion/effects/zigzag'; import {Solid, useCurrentFrame} from 'remotion'; export const MyComp: React.FC = () => { const frame = useCurrentFrame(); return ( <> <Solid width={1280} height={720} effects={[ zigzag({ colors: ['#d7b8ff', 'transparent'], direction: 'horizontal', thickness: 40, gap: 0, angle: 0, offset: frame * 2, amplitude: 40, wavelength: 160, }), ]} /> </> ); };

API​

Pass an object with the following properties. You can also call zigzag() without arguments.

colors?​

An array of color strings for the bands. Colors are assigned cyclically. Must contain at least 2 colors.

Defaults to ['#dff4ff', '#7cc6ff'].

direction?​

Base band direction before zig-zag displacement. Either 'horizontal' or 'vertical'. Defaults to 'horizontal'.

thickness?​

Thickness of each band in pixels. Defaults to 40.

gap?​

Transparent gap in pixels between each band. Defaults to 0.

With gap: 0 (the default), bands are packed solid with no gap between them — colors are directly adjacent to each other.
With gap > 0, a transparent band appears between each stripe, allowing the source content to show through.

angle?​

Rotates the pattern in degrees. Defaults to 0.

offset?​

Offset in pixels. Defaults to 0.

Animate this value with useCurrentFrame() to scroll the bands.

amplitude?​

Zig-zag displacement in pixels. Defaults to 40.

wavelength?​

Distance in pixels before the zig-zag repeats. Defaults to 160. Must be greater than 0.

maskToSourceAlpha?v4.0.474​

Masks the generated zig-zag pattern to the source alpha channel. Defaults to false.

Set this to true to prevent the zig-zag pattern from appearing in fully transparent source pixels.

disabled?​

When true, the effect is skipped. Defaults to false.

Requirements​

zigzag() uses a WebGL2 backend. See Using WebGL and WebGPU during renders.

See also​