Components

Circuit Board

An animated circuit board background for React: 45°-routed PCB traces with solder pads and small pulses travelling along them. Built with SVG and Tailwind CSS, seeded so it renders the same every time, and paused off-screen.

  • Background
  • SVG
  • Seeded layout
  • Pauses off-screen
  • Reduced-motion safe

Edge functions

Run code close to your users in 30 regions.

Installation

$ npx shadcn@latest add https://duskui.com/r/circuit-board.json

The board fills its nearest positioned parent, so give the parent relative and overflow-hidden, and put your content after it with relative so it sits on top.

Usage

hero.tsx
import { CircuitBoard } from "@/components/dusk/techy/circuit-board"

export function Hero() {
  return (
    <section className="relative overflow-hidden">
      <CircuitBoard />
      <div className="relative">{/* your content */}</div>
    </section>
  )
}

Examples

Colors & seeds

color takes any CSS color, including variables. Change seed to get a different, but stable, layout.

color="#a5b4fc"
color="#7dd3fc"

Dense board

Raise density, shrink cellSize and turn off fade for an edge-to-edge board. speed is in pixels per second.

density=0.8 · cellSize=14 · speed=140

A busy, edge-to-edge board for footers and section dividers.

API Reference

Any other div prop is passed to the root. The layout is generated in fixed-size chunks, so resizing the container only adds or removes chunks instead of reshuffling the board.

PropTypeDefaultDescription
colorstring"var(--color-primary)"Trace and pulse color. Any CSS color.
densitynumber0.4How many traces to route, from 0 to 1.
speednumber90Pulse speed in px per second.
cellSizenumber20Grid spacing between traces in px.
seednumber1Layout seed; the same seed always draws the same board.
fadebooleantrueFade the board out toward the edges.
classNamestring—Merged onto the absolutely positioned root.

Accessibility

  • The board is decorative: it is aria-hidden and pointer-events-none, so it never reaches screen readers or blocks clicks.
  • With prefers-reduced-motion, pulses are removed and the routes that carried them are drawn a little brighter instead.
  • The SVG timeline pauses while the board is off-screen or the tab is hidden, saving battery.
  • Keep foreground text on a solid or blurred surface, or rely on the default edge fade, to maintain contrast.