# Border Beam

> Send a short segment of light around an element's border to mark it as active or in progress.

Source: https://www.honestui.com/docs/animated/border-beam

```tsx
import { BorderBeam } from "@/registry/default/animated/border-beam";

export function BorderBeamDemo() {
  return (
    <div className="relative w-80 overflow-hidden rounded-xl border border-border bg-card p-5">
      <div className="flex items-center justify-between">
        <span className="text-[13px] text-muted-foreground">Deployment</span>
        <span className="inline-flex items-center gap-1.5 text-xs font-medium text-foreground">
          <span aria-hidden className="size-1.5 rounded-full bg-foreground/60" />
          Building
        </span>
      </div>
      <p className="mt-3 text-sm font-medium text-foreground">honest-ui · main</p>
      <p className="mt-1 text-xs text-muted-foreground">Started 42 seconds ago by the release workflow.</p>
      <BorderBeam duration={6} size={90} />
    </div>
  );
}

```

## Overview [#overview]

Border Beam draws a small light segment that travels around its parent's border. Use it on one element at a time to mark something as live or in progress, such as a running build, a highlighted plan, or the card a tour is pointing at. The beam follows the parent's corner radius, paints only inside the border width, and leaves the content untouched.

## Installation [#installation]

<CliBlock commands="[&#x22;border-beam&#x22;]" />

## Usage [#usage]

```tsx
import { BorderBeam } from "@/components/animated/border-beam"

<div className="relative overflow-hidden rounded-xl border p-5">
  Deploying…
  <BorderBeam duration={6} />
</div>
```

Place it as the last child of a `relative` element. The radius is read from the parent; pass `radius` when the parent's radius changes after mount. Two beams with opposite `reverse` values and half-lap `delay` give a symmetrical effect.

## Accessibility [#accessibility]

The beam is decorative and hidden from assistive technology. Pair it with a text status such as "Building" so the state is never conveyed by motion alone. When reduced motion is requested, the beam stops and rests as a short static highlight.

## API Reference [#api-reference]


  ### `size`

type: `number` · default: `72`

Length of the light segment in px.

  ### `duration`

type: `number` · default: `8`

Seconds for one lap.

  ### `delay`

type: `number` · default: `0`

Seconds before the first lap. Negative values start mid-lap.

  ### `colorFrom`

type: `string` · default: `&#x22;var(--foreground)&#x22;`

Color at the head of the beam.

  ### `colorTo`

type: `string`

Color the beam fades through toward its tail.

  ### `borderWidth`

type: `number` · default: `1`

Width of the border the beam travels on, in px.

  ### `radius`

type: `number`

Corner radius of the path. Defaults to the parent's border radius.

  ### `reverse`

type: `boolean` · default: `false`

Travels counterclockwise.

  ### `className`

type: `string`

Classes for the border layer.
