Skip to content

Stipple and pointillism

Playground

Move cursor over canvas to interact

Source Type

Headline String

Font Weight

Pattern Distribution

Variant

Cursor physics

Install

npm install @shavin/fx
import { StippleText, StippleImage } from "@shavin/fx";

Works with

React

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

Remotion

Live pages only; runs on its own clock

Anatomy

import { StippleText, StippleImage } from "@shavin/fx";

// Text drawn as dots
<StippleText text="SHAVIN" fontSize={120} density={1.2} />

// An image drawn as dots
<StippleImage src="/assets/hq_marshall.jpg" density={1.0} />

Examples

Headline

A headline drawn as a grid of dots. The pointer pushes dots away and they spring back.

Component Source
<StippleText
  text="SHAVIN.FX"
  fontSize={80}
  density={1.0}
  dotRadius={1.3}
  interactive={true}
  className="w-full h-40"
/>

Photo

A photo drawn as dots in its own colours, with more dots in the darker areas.

Component Source
<StippleImage
  src="/assets/hq_marshall.jpg"
  density={1.0}
  dotRadius={1.2}
  colorMode="preserve"
  interactive={true}
  className="w-full max-w-xs"
/>

Props

PropTypeDefaultDescription
text*string—StippleText only. The text to draw. Empty text falls back to "SHAVIN.FX".
fontSizenumber120StippleText only. Maximum font size in px; the text shrinks to fit the canvas.
fontWeightstring | number"900"StippleText only. Font weight used to draw the text.
fontFamilystringsystem-ui stackStippleText only. Font family used to draw the text.
letterSpacingstring"0.02em"StippleText only. Letter spacing used to draw the text.
src*string | { light: string; dark: string }—StippleImage only. Image URL, or a { light, dark } pair that follows the theme.
altstring""StippleImage only. Accessible description of the image.
pattern"grid" | "stochastic" | "organic""grid""grid" places dots on an even grid. "stochastic" and "organic" both use Poisson-disc sampling.
densitynumber1.0Dot density multiplier. Higher values place more, closer dots.
dotRadiusnumber1.2Dot radius in px.
interactivebooleantrueThe pointer (mouse, touch or pen) pushes dots away. Ignored under reduced motion.
repulsionRadiusnumber100Radius in px around the pointer that pushes dots.
springStiffnessnumber0.09How quickly dots return to their place.
colorMode"preserve" | "tint" | "monochrome" | "auto-invert""tint" (text) / "preserve" (image)"preserve" keeps the image's colours, "tint" draws dots in color, "monochrome" in the neutral fg ink, "auto-invert" keeps the image's colours but inverts their lightness in dark mode. "preserve" and "auto-invert" apply to images only.
colorFxColor: "fg" | "brand" | "muted" | string | { light: string; dark: string }"fg"Dot colour for colorMode="tint": a theme token, any CSS colour or var(--token), or a { light, dark } pair.
tintThemedValue<string>—Deprecated: use color.

* required

Configure Theme
Theme
Brand Color
Custom
Gray Family
Appearance
Radius
Scaling
Panel Style
Heading Font
Body Font