Line art
Playground
Figure
Colours
Pointer
Install
npm install @shavin/fximport { LineArt } from "@shavin/fx";Works with
React
Client component; Next.js and any React 18+ app
Remotion
Frame-exact through FxTimeProvider or time
Teal torus
Component Source
<LineArt preset="torus" colors={["oklch(0.55 0.12 200)", "oklch(0.85 0.14 165)"]} />Ribbon
Component Source
<LineArt preset="ribbon" colors={["oklch(0.55 0.2 290)", "oklch(0.75 0.15 230)", "oklch(0.9 0.08 200)"]} />Spirograph
Component Source
<LineArt preset="spirograph" opacity={0.4} />Props
| Prop | Type | Default | Description |
|---|---|---|---|
| preset | "torus" | "ribbon" | "spirograph" | "torus" | Which figure. |
| colors | "native" | "theme" | "brand-dark" | "brand-light" | string[] | { light: string[]; dark: string[] } | "native" | Line colours, first line to last: "native" the foreground colour throughout; "theme" a ramp of the brand that follows light/dark; "brand-dark" / "brand-light" that ramp forced to one side; or your own theme tokens (fg, brand) or CSS colours (an array, or { light, dark } arrays). |
| density | number | 1 | How many lines make the figure, 0.4 to 2. |
| lineWidth | number | 0.8 | Stroke width in CSS px. |
| opacity | number | 0.55 | Line opacity, 0 to 1; overlaps add up to brighter light on dark pages. |
| speed | number | 1 | Animation speed multiplier. |
| interactive | boolean | true | The figure turns toward the pointer (mouse, touch and pen). |
| time | number | — | Controlled time in seconds (e.g. frame / fps in Remotion); also read from FxTimeProvider. |