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/fximport { 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
| Prop | Type | Default | Description |
|---|---|---|---|
| text* | string | — | StippleText only. The text to draw. Empty text falls back to "SHAVIN.FX". |
| fontSize | number | 120 | StippleText only. Maximum font size in px; the text shrinks to fit the canvas. |
| fontWeight | string | number | "900" | StippleText only. Font weight used to draw the text. |
| fontFamily | string | system-ui stack | StippleText only. Font family used to draw the text. |
| letterSpacing | string | "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. |
| alt | string | "" | 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. |
| density | number | 1.0 | Dot density multiplier. Higher values place more, closer dots. |
| dotRadius | number | 1.2 | Dot radius in px. |
| interactive | boolean | true | The pointer (mouse, touch or pen) pushes dots away. Ignored under reduced motion. |
| repulsionRadius | number | 100 | Radius in px around the pointer that pushes dots. |
| springStiffness | number | 0.09 | How 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. |
| color | FxColor: "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. |
| tint | ThemedValue<string> | — | Deprecated: use color. |
* required