Skip to content

Moire Field

Interference patterns drift as two fine-line fields cross.

LIVE PREVIEWInteract with the component
Just React. No extra dependencies.

Copy the component and its CSS module into your project.

CSS Modules

Usage

Matches your current playground settings.

jsx
import MoireField from "./MoireField";
export default function Example() {
return (
<MoireField
color={"#ac94c4"}
background={"#17131d"}
spacing={12}
speed={30}
interactive={true}
minHeight={400}
children={"Between the lines."}
style={{
"fontSize": 38,
"letterSpacing": "-.05em",
"color": "#f2eaf8"
}}
/>
);
}

Using Moire Field

Use spacing to tune the interference pattern's density and minHeight to size the surrounding field.

Turn interactive off for a background that should drift without responding to the pointer. Keep text over a part of the field with sufficient contrast.

Props

NameTypeRequiredDefaultDescription
colorstringNo"#c3b5d6"Colour of both line fields.
backgroundstringNo"#17131d"Background CSS colour.
spacingnumberNo12Distance between rings in pixels, clamped to at least four.
speednumberNo30Animation cycle duration in seconds.
interactivebooleanNotrueLet horizontal pointer movement rotate the upper field.
minHeightnumber | stringNo360Minimum height in pixels or a CSS length.
childrenReactNodeNoundefinedOptional content layered over the pattern.
classNamestringNo""Additional CSS classes merged with the component styles.
styleCSSPropertiesNoundefinedInline styles for sizing, typography, and visual overrides.

Related components

Lava Lamp

Backgrounds

Warm liquid forms merge and drift inside a softly lit glass lamp.

Helix Field

Backgrounds

Two strands of shaded particles rotate around fine connecting rungs.

Wave Lattice

Backgrounds

A fine perspective mesh drifts over a sculpted wave surface.

Kinetic Mobile

Backgrounds

Suspended discs, rings and counterweights sway on fine connecting rods.