BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/componentry/circuit-board

circuit-board

componentry/circuit-board
FreeComponent

An interactive circuit board layout component with animated electricity paths that pulse between connected nodes. Fully theme-aware with automatic light/dark mode support.

Live preview

live · rendered by the registry
Rendered by componentry on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://componentry.dev/r/circuit-board.json

Source

components/ui/circuit-board.tsxcomponentry.dev/r/circuit-board.json · first 6 KB
1"use client"
2
3import * as React from "react"
4import { motion } from "framer-motion"
5import { cn } from "@workspace/ui/lib/utils"
6
7interface CircuitNode {
8 id: string
9 x: number
10 y: number
11 label?: string
12 icon?: React.ReactNode
13 status?: "active" | "inactive" | "processing" | "error"
14 size?: "sm" | "md" | "lg"
15}
16
17interface CircuitConnection {
18 from: string
19 to: string
20 animated?: boolean
21 bidirectional?: boolean
22 color?: string
23 pulseColor?: string
24}
25
26interface CircuitBoardProps extends React.HTMLAttributes<HTMLDivElement> {
27 nodes: CircuitNode[]
28 connections: CircuitConnection[]
29 width?: number
30 height?: number
31 gridSize?: number
32 showGrid?: boolean
33 gridColor?: string
34 traceColor?: string
35 pulseColor?: string
36 nodeColor?: string
37 pulseSpeed?: number
38 traceWidth?: number
39 /** Force a specific theme variant. Defaults to auto-detect from system. */
40 variant?: "light" | "dark" | "auto"
41}
42
43function CircuitBoard({
44 nodes,
45 connections,
46 width = 600,
47 height = 400,
48 gridSize = 20,
49 showGrid = true,
50 gridColor,
51 traceColor,
52 pulseColor,
53 nodeColor,
54 pulseSpeed = 2,
55 traceWidth = 2,
56 variant = "auto",
57 className,
58 ...props
59}: CircuitBoardProps) {
60 // Theme-aware color defaults
61 const [isDark, setIsDark] = React.useState(true)
62
63 React.useEffect(() => {
64 if (variant !== "auto") {
65 setIsDark(variant === "dark")
66 return
67 }
68
69 // Check for dark class on html/body
70 const checkTheme = () => {
71 const isDarkMode = document.documentElement.classList.contains("dark") ||
72 document.body.classList.contains("dark")
73 setIsDark(isDarkMode)
74 }
75
76 checkTheme()
77
78 // Listen for changes
79 const observer = new MutationObserver(checkTheme)
80 observer.observe(document.documentElement, { attributes: true, attributeFilter: ["class"] })
81 observer.observe(document.body, { attributes: true, attributeFilter: ["class"] })
82
83 const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)")
84 mediaQuery.addEventListener("change", checkTheme)
85
86 return () => {
87 observer.disconnect()
88 mediaQuery.removeEventListener("change", checkTheme)
89 }
90 }, [variant])
91
92 // Compute theme-aware colors
93 const computedGridColor = gridColor || (isDark ? "rgba(163, 163, 163, 0.08)" : "rgba(64, 64, 64, 0.12)")
94 const computedTraceColor = traceColor || (isDark ? "rgba(163, 163, 163, 0.25)" : "rgba(64, 64, 64, 0.35)")
95// … truncated

Facts

Registry
componentry
Type
registry:ui
Access
Free
Files written
0
Licence
MIT
First indexed
2026-08-02
Last confirmed
today

Go to the source

Docs on componentry componentry.dev harshjdhv/componentry on GitHub Raw registry item This item as JSON

More from componentry

All 59 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Animated Gradientanimated-gradientcomponentryComponentsFreeno deps
ASCII Effectascii-effectcomponentryComponentsFreeno deps
Aurora Flowaurora-flowcomponentryComponentsFreeno deps
auth-modalauth-modalcomponentryComponentsFreeno deps
border-beamborder-beamcomponentryComponentsFreeno deps
closing-plasmaclosing-plasmacomponentryComponentsFreeno deps
collection-surfercollection-surfercomponentryComponentsFreeno deps
Command Menucommand-menucomponentryComponentsFreeno deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex