Metaballs

Installation

npm i @paper-design/shaders-react

Code

import { Metaballs } from '@paper-design/shaders-react';

<Metaballs
  style={{ 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

NameDescriptionTypeValues
colorsUp to 8 base colorsstring[]Hex, RGB, or HSL color
colorBackBackground colorstringHex, RGB, or HSL color
countNumber of ballsnumber1 to 20
sizeThe size of the ballsnumber0 to 1
offsetXHorizontal offset of the graphics centernumber-1 to 1
offsetYVertical offset of the graphics centernumber-1 to 1
scaleOverall zoom level of the graphicsnumber0.01 to 4
rotationOverall rotation angle of the graphicsnumber0 to 360
speedAnimation speednumber0 to 2

Description

Up to 20 gooey blobs moving around the center and merging into smooth organic shapes.