Skip to content

Needle field

Playground

Pattern

Colour

Pointer

Install

npm install @shavin/fx
import { NeedleField } from "@shavin/fx";

Works with

React

Client component; Next.js and any React 18+ app

Remotion

Frame-exact through FxTimeProvider or time

Flow

Component Source
import { NeedleField } from "@shavin/fx/needle-field";

<NeedleField className="h-72" />

Wave

Component Source
<NeedleField pattern="wave" spacing={18} length={0.8} />

Still until hovered

Component Source
<NeedleField pattern="still" angle={75} spacing={20} thickness={1.6} reach={0.35} />

Radial, brand colour

Component Source
<NeedleField pattern="radial" color="brand" spacing={16} thickness={1.6} />

Props

PropTypeDefaultDescription
pattern"flow" | "wave" | "radial" | "still""flow"Idle motion of the grid.
spacingnumber22Grid spacing in CSS px.
lengthnumber0.7Needle length as a fraction of the spacing.
thicknessnumber1.2Stroke width in CSS px.
speednumber1Animation speed multiplier.
interactivebooleantrueNeedles near the pointer turn to face it and stretch (mouse, touch and pen).
reachnumber0.5Pointer reach as a fraction of the shorter side.
anglenumber90For the still pattern: the direction every needle rests at, in degrees (0 right, 90 up).
colorFxColor"fg"Needle colour: a theme token (fg, brand, muted), any CSS colour or var(--token), or a { light, dark } pair.
toneFxColor—Deprecated: use color.
grainnumber0Film grain over the canvas, 0 to 0.3 (0 is off).
timenumber—Controlled time in seconds (e.g. frame / fps in Remotion): draws exactly this moment, no clock of its own. Also read from FxTimeProvider.
Configure Theme
Theme
Brand Color
Custom
Gray Family
Appearance
Radius
Scaling
Panel Style
Heading Font
Body Font