Metaballs
Installation
npm i @paper-design/shaders-react
Code
import { Metaballs } from '@paper-design/shaders-react';
<Metaballs
height={500}
colors={["#cc3333", "#cc9933", "#99cc33", "#33cc33", "#33cc99"]}
colorBack="#000000"
count={10}
size={0.83}
offsetX={0}
offsetY={0}
scale={1}
rotation={0}
speed={1}
/>
Props
| Name | Description | Type | Values |
|---|---|---|---|
| colors | Up to 8 base colors | string[] | Hex, RGB, or HSL color |
| colorBack | Background color | string | Hex, RGB, or HSL color |
| count | Number of balls | number | 1 to 20 |
| size | The size of the balls | number | 0 to 1 |
| offsetX | Horizontal offset of the graphics center | number | -1 to 1 |
| offsetY | Vertical offset of the graphics center | number | -1 to 1 |
| width | CSS width style of the shader element | number | string | — |
| height | CSS height style of the shader element | number | string | — |
| scale | Overall zoom level of the graphics | number | 0.01 to 4 |
| rotation | Overall rotation angle of the graphics | number | 0 to 360 |
| speed | Animation speed | number | 0 to 2 |
Description
Up to 20 gooey blobs moving around the center and merging into smooth organic shapes.