# AnimatedBeam

> Fibre-optic connector between two elements: a light packet with a dispersing chromatic tail runs along a glass fibre and blooms behind the destination on arrival; theme-aware, seeded and still under reduced motion.

- Package: `fancy-ui-vue` (Vue 3.5+ + Tailwind CSS v4)
- Category: Effects
- Tags: animation, svg, beam, gradient, connection
- Types: `AnimatedBeamProps`
- Docs: https://fancy-ui.rama.app/docs/components/animated-beam
- Source: https://github.com/RamaHerbin/fancy-ui/tree/main/vue/src/components/animated-beam

## Import

```vue
<script setup lang="ts">
import { AnimatedBeam } from 'fancy-ui-vue';
</script>
```

Setup (once per project): `npm install fancy-ui-vue`, then put these lines in your main CSS file (the stylesheet imports go right after `@import "tailwindcss";`):

```css
@import "tailwindcss";
@import "fancy-ui-vue/tailwind.css";
@import "fancy-ui-vue/styles.css";
```

Full guide: https://fancy-ui.rama.app/llms.txt

The names below are the ones to write in a Vue template; when one differs from the Svelte name, the Svelte name follows in parentheses. Snippets become named slots (`#default` is the default snippet), a prop the Vue port declares as a model is a `v-model:<name>` (except `ref`, exposed via `defineExpose({ ref })`: put a template ref on the component and read `.ref`) and callbacks are listeners (`onclick` is `@click`). Every component sets `inheritAttrs: false`: `class` is a declared prop, merged where the Svelte component applies it (not always the root element), and only when the props table below lists it; other attributes do not fall through unless the package README lists the component as forwarding native attributes. Divergences: https://github.com/RamaHerbin/fancy-ui/tree/main/vue#divergences-from-the-svelte-api

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `containerRef` (required) | `HTMLElement` | — | Reference to the container element that holds both endpoints |
| `fromRef` (required) | `HTMLElement` | — | Reference to the source element |
| `toRef` (required) | `HTMLElement` | — | Reference to the destination element |
| `curvature` | `number` | `0` | Vertical curvature of the beam path |
| `reverse` | `boolean` | `false` | Reverse the animation direction |
| `pathColor` | `string` | `theme-aware glass` | CHANGED DEFAULT (was "gray"): unset draws the theme-aware glass fibre; a colour draws a plain line in that colour, as before. |
| `pathWidth` | `number` | `2` | Stroke width of the path |
| `pathOpacity` | `number` | `1 (glass) / 0.2 (with pathColor)` | CHANGED DEFAULT (was 0.2): fibre opacity; stays 0.2 whenever pathColor is set. |
| `gradientStartColor` | `string` | `"#FFAA40"` | Start color of the animated gradient |
| `gradientStopColor` | `string` | `"#9C40FF"` | End color of the animated gradient |
| `delay` | `number` | `0` | Animation delay in seconds |
| `duration` | `number` | `from seed` | CHANGED DEFAULT (was random): seconds per packet cycle; unset = mulberry32(seed)*3+4. |
| `pulses` | `number` | `1` | Packets in flight at once (1–12), spaced evenly over one cycle. |
| `tail` | `number` | `0.35` | Length of the packet's dispersing tail as a fraction of the fibre (0.05–0.9). |
| `glow` | `number` | `0.6` | Strength of the blurred glow under the packet and of the arrival bloom (0–1). |
| `seed` | `number` | `1` | Seed for the default duration (between 4 and 7 s), so server and browser agree. |
| `startXOffset` | `number` | `0` | Horizontal offset for the start point |
| `startYOffset` | `number` | `0` | Vertical offset for the start point |
| `endXOffset` | `number` | `0` | Horizontal offset for the end point |
| `endYOffset` | `number` | `0` | Vertical offset for the end point |

## Example

No Vue example is published for this component yet: start from the import above and the props table. The full examples are Svelte-only, on https://fancy-ui.rama.app/docs/components/animated-beam.md.
