animated-beam-bidirectional-demo
jolyui-ui/animated-beam-bidirectional-demoFreeExample
jolyui/ui publishes no description for this item.
Install it
npx shadcn@latest add https://jolyui.dev/r/animated-beam-bidirectional-demo.jsonSource
1import { Server, User } from "lucide-react";2import React from "react";3import {4 AnimatedBeam,5 BeamContainer,6 BeamNode,7} from "@/registry/default/ui/animated-beam";89export default function AnimatedBeamBidirectionalDemo() {10 const containerRef = React.useRef<HTMLDivElement>(null);11 const userARef = React.useRef<HTMLDivElement>(null);12 const userBRef = React.useRef<HTMLDivElement>(null);13 const serverRef = React.useRef<HTMLDivElement>(null);1415 return (16 <BeamContainer17 ref={containerRef}18 className="mx-auto flex w-full items-center justify-between rounded-xl border bg-background p-10 shadow-sm"19 >20 <div className="flex flex-col items-center gap-2">21 <BeamNode22 ref={userARef}23 className="h-12 w-12 border-2 border-blue-500/20 bg-blue-500/10"24 >25 <User className="h-6 w-6 text-blue-600" />26 </BeamNode>27 <span className="font-medium text-[10px] text-muted-foreground uppercase tracking-wider">28 User A29 </span>30 </div>3132 <div className="flex flex-col items-center gap-2">33 <BeamNode34 ref={serverRef}35 className="h-16 w-16 border-2 border-purple-500/20 bg-purple-500/10"36 >37 <Server className="h-8 w-8 text-purple-600" />38 </BeamNode>39 <span className="font-medium text-[10px] text-muted-foreground uppercase tracking-wider">40 Relay Server41 </span>42 </div>4344 <div className="flex flex-col items-center gap-2">45 <BeamNode46 ref={userBRef}47 className="h-12 w-12 border-2 border-amber-500/20 bg-amber-500/10"48 >49 <User className="h-6 w-6 text-amber-600" />50 </BeamNode>51 <span className="font-medium text-[10px] text-muted-foreground uppercase tracking-wider">52 User B53 </span>54 </div>5556 {/* User A <-> Server */}57 <AnimatedBeam58 containerRef={containerRef}59 fromRef={userARef}60 toRef={serverRef}61 duration={3}62 curvature={0.3}63 gradientStartColor="#3b82f6"64 gradientStopColor="#8b5cf6"65 />66 <AnimatedBeam67 containerRef={containerRef}68 fromRef={serverRef}69 toRef={userARef}70 duration={3}71 delay={1.5}72 curvature={0.3}73 reverse74 gradientStartColor="#8b5cf6"75 gradientStopColor="#3b82f6"76 />7778 {/* User B <-> Server */}79 <AnimatedBeam80 containerRef={containerRef}81// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from jolyui/ui
All 199 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| ai-prompt-box-demoai-prompt-box-demo | jolyui/ui | Examples | Free | no deps | |
| ai-prompt-box-loading-demoai-prompt-box-loading-demo | jolyui/ui | Examples | Free | no deps | |
| animated-beam-curved-demoanimated-beam-curved-demo | jolyui/ui | Examples | Free | 1 dep | |
| animated-beam-demoanimated-beam-demo | jolyui/ui | Examples | Free | 1 dep | |
| animated-beam-multiple-demoanimated-beam-multiple-demo | jolyui/ui | Examples | Free | 1 dep | |
| animated-table-basic-demoanimated-table-basic-demo | jolyui/ui | Examples | Free | no deps | |
| animated-table-column-demoanimated-table-column-demo | jolyui/ui | Examples | Free | no deps | |
| animated-table-expand-demoanimated-table-expand-demo | jolyui/ui | Examples | Free | no deps |
