No. 03 ยท background lines
linescape
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 linescapeWhat it does
- No. 01
Placed on purpose
Centered, corner to corner, through a point at an angle: positions read like CSS background-position.
- No. 02
Right at any size
Positions are relative, thickness and wave sizes stay in pixels, so lines keep their character from phone to wide screen.
- No. 03
Wiggles, loops and swirls
Seven patterns, cursive loops, spirals and kinks, on straight lines, curves, arcs and rings.
- No. 04
Thick, if you like
Hundreds of pixels wide is a first-class use: bands, hollow lines, tapers, parallel stripes.
- No. 05
Gradients and color along the line
Solid, linear and radial paint, or color that shifts from one end of the line to the other.
- No. 06
Animated, gently
Draw on load, when scrolled into view or with the scroll; flowing dashes; waves that travel. Reduced motion respected.
Presets
Starting points: spread one and change what you like. Each opens in the playground.
In React
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: "#e0577f",
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.