Background Lines
interlace-ui/background-linesFreeComponent
A full-bleed backdrop of twelve long, sweeping SVG curves that draw themselves in and fade out on a loop, each staggered by a fixed delay so the field never pulses in unison.
Install it
npx shadcn@latest add https://ds.interlace.tools/r/background-lines.jsonSource
1"use client";23import { cn } from "@/lib/utils";45// @interlace/background-lines v1.1.0 — Interlace design system.6// Docs, props and live preview: https://ds.interlace.tools/c/background-lines7// What changed since: https://ds.interlace.tools/c/background-lines#history8// Generated banner — keep it, the upgrade diff reads this version.910/**11 * @interlace/ui — BackgroundLines12 *13 * A full-bleed backdrop of twelve long, sweeping SVG curves that draw14 * themselves in and fade out on a loop, each staggered by a fixed delay so the15 * field never pulses in unison.16 *17 * Your children render above it on a `z-10` layer; the container is18 * `h-[20rem] md:h-screen`.19 *20 * Our reimplementation of the Aceternity UI effect of the same name. What is21 * ours: the path count is cut to twelve, the per-path delays are a fixed22 * lookup table rather than `Math.random()` (so server and client agree and the23 * field is reproducible), and both the wrapper and the SVG are `memo`'d behind24 * an `IntersectionObserver` that unmounts the whole layer off-screen.25 *26 * ## Anatomy27 *28 * BackgroundLines (div — bg-white dark:bg-black, isolate,29 * contain: layout style paint)30 * ├─ div.absolute.inset-031 * │ └─ SVG (motion.svg, viewBox 0 0 1440 900,32 * │ └─ motion.path ×12 opacity 0.4, aria-hidden,33 * │ pointer-events-none)34 * └─ div.z-10 (your children)35 *36 * Each path animates `strokeDashoffset 800 → 0` with the dash pattern37 * tightening from `"50 800"` to `"20 800"` and opacity running `[0, 1, 1, 0]`,38 * so the stroke reads as a comet drawing along the curve.39 *40 * ## Motion41 *42 * JS-driven — `motion/react` variants on twelve paths, `repeat: Infinity`. The43 * CSS reset in `styles/preflight.css` cannot reach motion's inline styles, so44 * the gate is in JS and it is total: the layer renders only under45 * `{isVisible && !reduceMotion && <SVG …/>}`, so under46 * `prefers-reduced-motion: reduce` no SVG mounts at all and the surface is a47 * plain white (or black) box behind your content.48 *49 * ## What it does not give you50 *51 * - The twelve stroke colours are a hard-coded hex array in this file and are52 * not props. Neither are the paths. `svgOptions.duration` (default 10s) is53 * the only knob.54 * - The surface is `bg-white dark:bg-black`, not a background token.55// … truncated
More from interlace-ui
All 140 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| A11y Startera11y-starter | interlace-ui | Components | Free | no deps | |
| Accordionaccordion | interlace-ui | Components | Free | no deps | |
| Alertalert | interlace-ui | Components | Free | no deps | |
| Alert Dialogalert-dialog | interlace-ui | Components | Free | no deps | |
| Animated Gradient Textanimated-gradient-text | interlace-ui | Components | Free | no deps | |
| Animated Grid Patternanimated-grid-pattern | interlace-ui | Components | Free | no deps | |
| Animated Listanimated-list | interlace-ui | Components | Free | no deps | |
| Article Cardarticle-card | interlace-ui | Components | Free | no deps |
