Designed background lines for the web: bands, sweeps, wiggles, loops and swirls behind your content, placed on purpose and rebuilt for every size.
npm install linescapeCentred, corner to corner, through a point at an angle: positions read like CSS background-position.
Positions are relative, thickness and wave sizes stay in pixels, so lines keep their character from phone to wide screen.
Seven patterns, cursive loops, spirals and kinks, on straight lines, curves, arcs and rings.
Hundreds of pixels wide is a first-class use: bands, hollow lines, tapers, parallel stripes.
Solid, linear and radial paint, or colour that shifts from one end of the line to the other.
Draw on load, when scrolled into view or with the scroll; flowing dashes; waves that travel. Reduced motion respected.
Starting points: spread one and change what you like. Each opens in the playground.
import { linescapeParentStyle } from "linescape";
import { Linescape } from "linescape/react";
export function Hero({ children }) {
return (
<section style={linescapeParentStyle}>
<Linescape line={{
path: { from: "left 80%", to: "right 30%", bend: 0.08 },
features: [{ type: "loop", at: 0.55, radius: 50 }],
width: 48,
paint: "#7c5cff",
animate: { draw: true },
}} />
{children}
</section>
);
}The line is redrawn for the section's real size whenever it changes. See getting started for Next.js, several lines, SVG output and the full spec.