# BorderBeam

> A single comet of light riding a container's border: a white-hot head, a long feathered tail fading between two colours, a dim hairline that lights up only within the comet's reach, and a soft bloom that sits on the edge.

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

## Import

```vue
<script setup lang="ts">
import { BorderBeam } 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 |
| --- | --- | --- | --- |
| `size` | `number` | `200` | Diameter of the pool of light around the comet's head, in pixels |
| `duration` | `number` | `9` | Time for one full lap of the border, in seconds |
| `borderWidth` | `number` | `1.5` | Border width in pixels |
| `anchor` | `number` | `90` | Where the comet starts (and rests with reduced motion), as a percentage of the perimeter clockwise from the top-left (0-100) |
| `colorFrom` | `string` | `"#8ec5ff"` | Colour of the head and the start of the tail |
| `colorTo` | `string` | `"#c084fc"` | Colour the tail fades into |
| `delay` | `number` | `0` | Seconds behind the start position; the comet runs from the first frame |
| `tail` | `number` | `0.25` | Length of the tail as a share of the perimeter (0-1) |
| `glow` | `number` | `0.6` | Strength of the bloom, halo and inner spill of light (0-1) |
| `reverse` | `boolean` | `false` | Travel counter-clockwise instead of clockwise |

## Example

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

<template>
	<div
		class="relative mx-auto w-full max-w-md overflow-hidden rounded-2xl border p-6 [--border-beam-radius:16px]"
	>
		<p class="text-sm font-medium">Deploy in progress</p>
		<p class="text-xs opacity-60">edge-eu-west · build 1482</p>
		<BorderBeam />
	</div>
</template>
```
