Skip to main content
Version: Next

AnimatedBeam

ui-animated-beam powers AnimatedBeam as the framework-agnostic integration-diagram primitive from @editora/ui-core. It measures slotted nodes and hubs, then renders animated SVG beam paths between them. That makes it a strong fit for integration heroes, AI routing visuals, workflow maps, and product storytelling around orchestrated systems.

Best For

  • Integration and automation diagrams
  • AI system maps with a central model or control plane
  • Product pages that need animated directional flow
  • Workflow visuals where one hub coordinates multiple endpoints

Import

import '@editora/ui-core';

Basic Usage

<ui-animated-beam
variant="minimal"
tone="brand"
columns="3"
rows="5"
path="true"
glow="true"
>
<button data-ui-animated-beam-node node-id="user" column="1" row="3" aria-label="User">
User
</button>

<div slot="hub" data-ui-animated-beam-hub node-id="hub" column="2" row="3">
AI
</div>

<button data-ui-animated-beam-node node-id="drive" column="3" row="1" aria-label="Drive">
Drive
</button>
<button data-ui-animated-beam-node node-id="docs" column="3" row="2" aria-label="Docs">
Docs
</button>

<div slot="connections" data-ui-animated-beam-connection from="user" to="hub"></div>
<div slot="connections" data-ui-animated-beam-connection from="hub" to="drive" curve="arc"></div>
<div slot="connections" data-ui-animated-beam-connection from="hub" to="docs" curve="soft"></div>
</ui-animated-beam>

Slot Structure

Use these markers:

  • data-ui-animated-beam-node: marks a standard endpoint node
  • slot="hub" and data-ui-animated-beam-hub: marks the main hub node
  • slot="connections" and data-ui-animated-beam-connection: marks connection metadata entries

Every node or hub should have a stable node-id, and every connection must reference from and to.

Layout Guidance

  • Use columns and rows to define the virtual placement grid.
  • Use column-gap and row-gap to space the diagram.
  • Use node-size and hub-size to rebalance the visual hierarchy.
  • Use min-height when the beam map lives inside a hero or section with a fixed canvas.
  • Use curve="straight" for direct flows, soft for gentler bends, and arc for bigger fan-out motion.

Motion Guidance

  • animation="calm" keeps the energy restrained.
  • animation="smooth" is the balanced default.
  • animation="snappy" makes the beam feel sharper and more product-like.
  • animation="surge" makes the beam itself more pronounced and theatrical.
  • animation="pulse" turns the beam into a traveling burst instead of a simple fill-across-progress effect.
  • animation="heartbeat" adds a more expressive double-beat cadence for routes that should feel more alive.
  • Connections follow their declared path, so downstream beams wait until the upstream route reaches their from node.
  • Use stagger when you want sibling branches to sequence instead of firing together.
  • Individual delay values on connection elements add extra offset after that upstream handoff.
  • Set repeat="false" when the sequence should run once and hold the finished state.
  • Use direction="reverse" on the root or a connection to send the beam back toward the source.
  • Add reverse on the root or a specific connection when the motion should travel back toward the source.
  • Use node-effect="pulse" when the slotted node or hub should pulse on arrival. That is separate from the beam-level animation="pulse" and animation="heartbeat" presets.

Variants And Tone

ui-animated-beam follows the same token-driven surface model as the newer premium components:

  • surface
  • soft
  • solid
  • glass
  • contrast
  • minimal

The selected tone affects the shell accents and default beam palette. Use color-start, color-end, and trail-color when you want a custom beam treatment for the story you are telling.

Beam Color Direction

These beam gradients are useful starting points when you want quick visual variations without changing the diagram structure:

  • color-start="#8b5cf6" with color-end="#fb923c" for an editorial AI-system feel
  • color-start="#06b6d4" with color-end="#2563eb" for a cooler systems or infrastructure direction
  • color-start="#84cc16" with color-end="#f59e0b" for a brighter, more energetic route
  • color-start="#f43f5e" with color-end="#fb923c" for alerting or high-signal motion states

Attributes

AttributeTypeDefaultDescription
animationcalm | smooth | snappy | surge | pulse | heartbeatsmoothNamed beam-motion preset
variantsurface | soft | solid | glass | contrast | minimalminimalSurface treatment
tonebrand | neutral | info | success | warning | dangerbrandAccent tone
sizexxs | xs | sm | md | lg | 0 | 1 | 2 | 3mdPreset shell scale
radiusCSS length or semantic tokensize-basedShell radius override
elevationnone | low | highlowShell shadow depth
columnsnumber3Virtual column count
rowsnumber3Virtual row count
paddingCSS lengthsize-basedInner shell padding
column-gapCSS lengthsize-basedHorizontal column spacing
row-gapCSS lengthsize-basedVertical row spacing
min-heightCSS lengthsize-basedMinimum canvas height
node-sizeCSS lengthsize-basedStandard node size
hub-sizeCSS lengthsize-basedHub size
durationCSS time3200msBase beam travel duration
delayCSS time0msGlobal playback delay
staggerCSS time0msAdditional delay between sibling connections without their own delay
trail-widthCSS lengthsize-basedStatic path width
beam-widthCSS lengthsize-basedAnimated beam width
beam-factornumberanimation-basedRelative beam segment length
pathboolean-liketrueShows the underlying path guide
glowboolean-liketrueEnables beam glow
node-effectnone | glow | pulse | ring | shakenoneArrival effect applied to hubs and nodes when the beam lands
pausedbooleanabsentForces playback to pause
repeatboolean-liketrueRepeats the sequence or runs it once
directionforward | reverseforwardBeam travel direction
reversebooleanabsentReverses all connections by default
color-startCSS colortone-basedBeam gradient start
color-endCSS colortone-basedBeam gradient end
trail-colorCSS colorneutral trailStatic path color
curveauto | straight | soft | arcautoDefault connection curve

Connection Attributes

Connection elements also support:

  • from
  • to
  • curve
  • direction
  • reverse
  • duration
  • delay
  • tone
  • color-start
  • color-end
  • beam-factor
  • trail-width
  • beam-width

Methods

const beam = document.querySelector('ui-animated-beam');
beam?.pause();
beam?.play();
beam?.refresh();

Notes

  • Reduced-motion environments keep the layout but tone down the animation automatically.
  • Numeric length and time values are normalized for you.
  • This component is intentionally diagram-oriented; it is not a replacement for a full node-graph editor.
  • Call refresh() if the container or node layout changes after mount.