Electric Border Card
Card wrapper with layered SVG electric glow and turbulence displacement on the border. Idle state is a subtle chrome border; hover or focus-within activates the electric border effect.
Default
Compact card - hover to activate the electric border
Hover to energize
Electric border card
arcColor tints the lightning; accentColor tints the hover shadow and glow.
default-example.tsx
1import { ElectricBorderCard } from "@/registry/ui/electric-border-card";23export function ElectricBorderCardDefaultExample() {4 return (5 <div className="flex min-h-[320px] items-center justify-center rounded-xl bg-[#0d0d0d] p-8">6 <ElectricBorderCard7 className="w-full max-w-sm p-8"8 radius={20}9 arcColor="#00d3f2"10 accentColor="#00d3f2"11 >12 <div className="space-y-2 text-center">13 <p className="text-xs font-bold tracking-[0.2em] text-white/50 uppercase">14 Hover to energize15 </p>16 <h3 className="text-lg font-semibold text-white">17 Electric border card18 </h3>19 <p className="text-sm text-white/60">20 <code className="text-cyan-400/90">arcColor</code> tints the21 lightning; <code className="text-cyan-400/90">accentColor</code>{" "}22 tints the hover shadow and glow.23 </p>24 </div>25 </ElectricBorderCard>26 </div>27 );28}
Wrapped card
Electric border around an existing card - shows the generic wrapper pattern
Wrap any component
The electric border follows this card's bounds - drop in forms, charts, or other UI as children.
This demo uses a dark green accentColor for the outer glow and a light green arcColor for the lightning stroke.
wrapped-card-example.tsx
1import { Button } from "@/components/ui/button";2import {3 Card,4 CardContent,5 CardDescription,6 CardFooter,7 CardHeader,8 CardTitle,9} from "@/components/ui/card";10import { ElectricBorderCard } from "@/registry/ui/electric-border-card";11import { Zap } from "lucide-react";1213export function ElectricBorderCardWrappedCardExample() {14 return (15 <div className="flex min-h-[360px] items-center justify-center rounded-xl bg-[#0d0d0d] p-8">16 <ElectricBorderCard17 className="w-full max-w-md"18 contentClassName="p-1"19 radius={16}20 arcColor="#009e0b"21 accentColor="#004f18"22 >23 <Card className="border-0 bg-zinc-950/90 text-zinc-100 shadow-none">24 <CardHeader className="gap-1">25 <div className="mb-2 flex size-10 items-center justify-center rounded-lg bg-blue-500/15 text-blue-400">26 <Zap className="size-5" strokeWidth={2} />27 </div>28 <CardTitle className="text-lg">Wrap any component</CardTitle>29 <CardDescription className="text-zinc-400">30 The electric border follows this card's bounds - drop in31 forms, charts, or other UI as children.32 </CardDescription>33 </CardHeader>34 <CardContent>35 <p className="text-sm text-zinc-500">36 This demo uses a dark green{" "}37 <code className="text-green-500">accentColor</code> for the outer38 glow and a light green{" "}39 <code className="text-green-300">arcColor</code> for the lightning40 stroke.41 </p>42 </CardContent>43 <CardFooter>44 <Button45 type="button"46 variant="secondary"47 className="w-full bg-zinc-800 text-zinc-100 hover:bg-zinc-700"48 >49 Get started50 </Button>51 </CardFooter>52 </Card>53 </ElectricBorderCard>54 </div>55 );56}
Installation & source
Install via the shadcn CLI or copy the registry files manually.
bash
npx shadcn@latest add @tt-ui/electric-border-card
Props
| Name | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | Required | Card content rendered above the glow layers |
| className | string | "" | Classes on the root card element |
| contentClassName | string | "" | Classes on the inner content wrapper |
| accentColor | string | "#000b9e" | Hover glow and shadows (box-shadow, background bloom, SVG halo). Any CSS color. |
| arcColor | string | "#9e0000" | Lightning stroke: turbulent core arc and flicker layers (CSS color) |
| radius | number | 24 | Corner radius in pixels for border and SVG rects |
| volumetricShadow | boolean | true | When true, apply accentColor-driven inset/outset shadows on hover |
| active | boolean | undefined | Controlled active state; when omitted, hover and focus-within drive the effect |
| as | "div" | "aside" | "section" | "div" | Semantic root element |