Skip to content

Border beam

Playground

Usage-based billing

Pay for the seats and runs you use, invoiced monthly.

Colour

Install

npm install @shavin/fx
import { BorderBeam } from "@shavin/fx";

Works with

React

Client component; Next.js and any React 18+ app

Remotion

Frame-exact through FxTimeProvider or time

On a card

Place it as the last child of a positioned, rounded container. It reads the container's size and corner radii and redraws when the size changes.

Usage-based billing

Pay for the seats and runs you use, invoiced monthly.

Component Source
import { BorderBeam } from "@shavin/fx";

<div className="relative rounded-[var(--radius-panel)] border border-hairline bg-surface p-6">
  …
  <BorderBeam />
</div>

Props

PropTypeDefaultDescription
durationnumber6Seconds per lap of the border.
lengthnumber0.18Comet length as a fraction of the border.
widthnumber1.5Core stroke width in px.
glownumber4Glow blur radius in px (0 turns it off).
tracknumber0Opacity of the faint full border (0 hides it).
countnumber1Comets spaced evenly around the border.
colorFxColor"brand"Colour: a theme token (fg, brand, muted), any CSS colour or var(--token), or a { light, dark } pair.
toneFxColor—Deprecated: use color.
timenumber—Controlled time in seconds (e.g. frame / fps in Remotion): draws exactly this moment, no clock of its own. Also read from FxTimeProvider.
Configure Theme
Theme
Brand Color
Custom
Gray Family
Appearance
Radius
Scaling
Panel Style
Heading Font
Body Font