Shadcn Animated Beam Components

Animated light beams that flow between elements to explain how data, requests or AI agents connect, with curves, reverse direction, delays, offsets and custom gradients. The lines follow the layout on resize and pause for reduced motion. Browse our collection of 20 Shadcn Animated Beam variants.

Basic

Integrations hub

Two way sync

Device
Cloud

Data pipeline

CSV import
Enrich with AI
Warehouse

AI agent tools

Web search
Gmail
Calendar

Zigzag payment flow

Checkout
Card network
Bank

Team collaboration

O
L
E
N

Curved route

CI/CD pipeline

Commit
Build
Test
Deploy

Unified inbox

Inbox

Radial network

Chat messages

O

Are we still on for 3pm?

L

Yes, see you there!

Staircase webhook

invoice.paid
API
DB

Load balancer

Load balancer
eu-west-1
us-east-1
ap-south-1

Voice loop

Peer to peer mesh

Ring network

1
2
3
4
5
6

Vertical upload

Uploading 3 photos

Global route

SFO
NYC
LDN
FRA
SIN

Model routing

Chat
Search
Docs
Fast
Smart
Unlock premium components
Get full control of shadcn/ui components, blocks and instances, including future additions.

Explore Shadcn Blocks

Ready-made page sections built with the same components.

View all blocks

Shadcn Animated Beam Component

The Shadcn Animated Beam draws a line between two elements and sends a light along it. It turns a static diagram into a living one, so visitors can see how data moves through your product, how an AI agent calls its tools or which apps your platform connects to.

This collection has twenty minimal diagrams, each with its own layout: chains, fan outs, fan ins, a radial hub, a ring, a peer to peer mesh, a zigzag, a staircase, a loop, a vertical beam, a map like route and crossing many to many routes. They cover integrations, AI agents, data pipelines, payments, CI/CD, notifications, chat, load balancing and model routing. It is a React component for shadcn/ui and Tailwind CSS built with SVG and CSS, with no animation library.

What is the Shadcn Animated Beam Component?

AnimatedBeam takes three refs: a relative container, the element where the beam starts and the element where it ends. It measures their centers, draws a quadratic curve between them and animates a gradient dash along the path. A ResizeObserver redraws the path when the layout changes, so beams stay attached on every screen size.

Several beams can share one container. Use delay to make them run one after another, reverse to send data back, and curvature to fan beams out from a central hub.

Anatomy of the Shadcn Animated Beam

PartDescription
AnimatedBeamThe SVG beam. Required props: containerRef, fromRef and toRef. Optional: curvature, reverse, duration, delay, beamLength, path and gradient colors and start or end offsets.
Container and nodesA relative wrapper and the elements to connect. Give the nodes z-10 and a background so the beam passes behind them.

20 Shadcn Animated Beam Variants

Each animated beam variant listed here is previewed live at the top of this page, together with its source code and install command.

  • Basic: A laptop connected to a server.
  • Integrations hub: Google, Slack and GitHub on one side and Figma, Discord and LinkedIn on the other, connected through a central product node.
  • Two way sync: Parallel upload and download beams between a device and the cloud.
  • Data pipeline: CSV import, AI enrichment and a warehouse in a horizontal chain.
  • AI agent tools: A user prompt reaching an agent that calls web search, Gmail and Calendar.
  • Zigzag payment flow: Checkout, card network and bank placed left, right and left.
  • Team collaboration: Four teammates connected to one shared document.
  • Curved route: A request arching through an edge server to the origin.
  • CI/CD pipeline: Commit, build, test and deploy stages from top to bottom.
  • Unified inbox: Email, chat, phone and Slack converging into one inbox.
  • Radial network: Six app logos in a circle flowing into a central AI node.
  • Chat messages: Two people with messages flowing in both directions.
  • Staircase webhook: A webhook event stepping down diagonally to the API and the database.
  • Load balancer: Traffic split from one node to three regions, each in its own color.
  • Voice loop: Microphone, assistant and speaker connected in a triangle loop.
  • Peer to peer mesh: Four devices in a square, all connected to each other.
  • Ring network: Six numbered nodes where light travels around the circle.
  • Vertical upload: A single fast beam from a phone up to the cloud.
  • Global route: A request hopping across scattered city points like a map.
  • Model routing: Three apps routed to two models with crossing beams.

How to Install the Shadcn Animated Beam Component

Set up shadcn/ui in your project if you have not already, then add the Shadcn UI Kit registry to your components.json once:

{
  "registries": {
    "@shadcnuikit": "https://shadcnuikit.com/r/{name}.json"
  }
}

Then install a animated beam variant by its name:

npx shadcn@latest add @shadcnuikit/animatedbeam1

The same command works with pnpm dlx, yarn dlx and bunx --bun. Each variant has a copy button for every package manager, and the code is added to your project as plain React and Tailwind CSS that you can edit freely.

How to Use the Shadcn Animated Beam Component

Create refs for the container and both nodes, then render AnimatedBeam inside the container.

"use client"

import { useRef } from "react"

import { AnimatedBeam } from "@/components/ui/animated-beam"

export function Connection() {
  const containerRef = useRef<HTMLDivElement>(null)
  const fromRef = useRef<HTMLDivElement>(null)
  const toRef = useRef<HTMLDivElement>(null)

  return (
    <div ref={containerRef} className="relative flex justify-between p-6">
      <div ref={fromRef} className="z-10 size-12 rounded-full border bg-background" />
      <div ref={toRef} className="z-10 size-12 rounded-full border bg-background" />
      <AnimatedBeam containerRef={containerRef} fromRef={fromRef} toRef={toRef} />
    </div>
  )
}

Why Use the Shadcn Animated Beam Component

  • Explains your product visually: Shows how parts connect without a paragraph of text.
  • Follows the layout: Paths are measured from real elements and redraw on resize.
  • Lightweight: SVG and a CSS keyframe, no animation library.
  • Composable: Combine beams with delays, curves and reverse direction for any diagram.
  • Theme aware: The base path uses your muted foreground color and gradients accept CSS variables.

Common Animated Beam Use Cases

  • Integrations sections: Apps flowing into your product.
  • AI agents: Prompts, models and tool calls.
  • Data platforms: Pipelines from source to warehouse.
  • Fintech: Payment and transfer flows.
  • Collaboration: People working on shared content.
  • Infrastructure: Requests through edge and origin servers.

Customizing the Shadcn Animated Beam

Change the moving light with gradientStartColor and gradientStopColor, the resting line with pathColor, pathWidth and pathOpacity, and the length of the light with beamLength as a percentage of the path. Offsets move the start and end points away from the node centers, which is useful for two parallel beams.

<AnimatedBeam
  containerRef={containerRef}
  fromRef={deviceRef}
  toRef={cloudRef}
  curvature={30}
  startYOffset={-8}
  endYOffset={-8}
  gradientStartColor="var(--color-emerald-400)"
  gradientStopColor="var(--color-sky-400)"
/>

Animated Beam Accessibility

The beam is decorative and the SVG is aria-hidden. Describe the flow in the surrounding text or with labels on the nodes, so screen reader users get the same information.

When the user prefers reduced motion, the moving light is hidden and only the static path remains, so the diagram still shows the connections.

Animated Beam Best Practices

  • Label the nodes so the diagram makes sense without animation.
  • Use delays to show order, such as one step finishing before the next starts.
  • Keep beams behind nodes by giving nodes z-10 and a background.
  • Limit the number of beams; six to eight is usually enough.
  • Use reverse for responses or downloads, so direction carries meaning.

Shadcn Animated Beam for AI Agents

Animated Beam lets an agent turn a list of connections into a living diagram: integrations flowing into your product, an AI agent calling tools, a data pipeline or a payment flow. Claude Code can lay out the nodes, create refs, fan beams out with curvature and use delays so steps run in order.

Install it with an AI agent

Claude Code, Cursor, Codex and other agents can install these with the shadcn CLI, for example npx shadcn@latest add @shadcnuikit/animatedbeam1. With the Shadcn UI Kit MCP server, your agent can search every variant by name and add the right one for you. To give it full context, share /components/animated-beam.md, the Markdown version of this page with every variant and install command.

Example prompts

  • “Build an integrations section with our six partner logos on both sides of the product logo, connected with AnimatedBeam.”
  • “Show how our AI agent works: user to agent, then agent to web search, Gmail and Calendar with delayed beams.”
  • “Add a vertical payment flow diagram from checkout to card network to bank with emerald beams.”

Customize it with AI

Each beam needs a relative container ref and stable refs for both ends, so the agent should use useRef or createRef in useMemo for lists, never refs created during render. Nodes need z-10 and a background so beams pass behind them, and labels so the diagram makes sense without motion.

Components Related to Animated Beam

Shadcn Animated Beam FAQ

Give the container, the start element and the end element refs, then render <AnimatedBeam containerRef={containerRef} fromRef={fromRef} toRef={toRef} /> inside the relative container.

Give each beam a delay. For example, the second step of a pipeline can use delay={0.75} with duration={1.5}, so it starts when the first light is halfway.

Yes. A ResizeObserver watches the container and both nodes and redraws the path whenever their size or position changes.

No. It is an SVG path animated with a CSS keyframe on stroke-dashoffset.

Yes. The moving light is hidden for users who prefer reduced motion, and the static connection line stays visible.

Yes. Claude Code, Cursor, Copilot and other assistants can add a animated beam variant with the shadcn CLI or the shadcn MCP server, for example npx shadcn@latest add @shadcnuikit/animatedbeam1. With a Pro plan, the Shadcn UI Kit MCP server can also build complete sections and pages around it.

Open /components/animated-beam.md to get this page as Markdown, with every animated beam variant, its description and install command. Paste the link or the text into your AI tool so it uses the real component code instead of guessing.

Looking for something else? Browse all shadcn/ui components or ready-made UI blocks built with them.

Shadcn Animated Beam component preview