# Moving Waves

A seamless wave background that flows upward.

Element page: [https://www.remotion.dev/elements/backgrounds/moving-waves/](https://www.remotion.dev/elements/backgrounds/moving-waves/)

## Installation

Install this Element into a composition of your Remotion project:

```sh
npx remotion elements use https://www.remotion.dev/elements/backgrounds/moving-waves/ --composition <composition-id> --yes
```

Replace `<composition-id>` with the ID of the composition to add the Element to. The command installs the dependencies, downloads the assets, writes the source file and adds the Element to the composition. See [`npx remotion elements use`](https://www.remotion.dev/docs/cli/elements/use.md).

## Manual installation

To install the Element manually instead, save the source below as `moving-waves.element.tsx` in your Remotion project and import its exported component.

## Source

```tsx
import {waves} from '@remotion/effects/waves';
import React from 'react';
import {Interactive, Solid, useCurrentFrame, useVideoConfig} from 'remotion';

const MovingWavesInner: React.FC = () => {
	const frame = useCurrentFrame();
	const {durationInFrames, height, width} = useVideoConfig();

	return (
		<Solid
			color="#dff4ff"
			width={width}
			height={height}
			effects={[
				waves({
					colors: ['#dff4ff', '#7cc6ff'],
					direction: 'horizontal',
					thickness: 56,
					gap: 0,
					angle: 0,
					offset: (frame / durationInFrames) * 448,
					amplitude: 24,
					wavelength: 160,
					phase: 0,
				}),
			]}
		/>
	);
};

export const MovingWaves = Interactive.create({
	Component: MovingWavesInner,
	layout: 'absolute-fill',
});
```

