Skip to Content
zjkm-ui
Components

Liquid Shapes

Liquid shapes that merge.

Fluid by default

Props
10s
<LiquidShapes>
  <Hero />
</LiquidShapes>

Installation

npx shadcn@latest add https://ui.zjkm.tech/r/liquid-shapes.json
import { LiquidShapes } from "@/components/liquid-shapes"

Using JavaScript? Set tsx: false in components.json and the CLI converts it.

New to shadcn? Run npx shadcn@latest init first. The CLI needs components.json and the @/ import alias.

Usage

Blobs drift behind your content, and where they touch they fuse like liquid. It's an SVG filter with the blobs moved by CSS, so there's no script running per frame.

import { LiquidShapes } from "@/components/liquid-shapes";

export function Hero() {
  return (
    <LiquidShapes className="rounded-2xl bg-neutral-950 p-16">
      <h1 className="text-white">Fluid by default</h1>
    </LiquidShapes>
  );
}

Props

PropTypeDefaultDescription
childrenReactNodeContent shown over the shapes.
colorFromstring"#8b5cf6"Gradient start colour.
colorTostring"#ec4899"Gradient end colour.
speednumber10Seconds per drift.
classNamestringClasses for the wrapper.

With reduced motion, the shapes stay still.

On this page