TeamMost popular
$24per seat, monthly
  • Unlimited projects
  • A preview URL for every pull request
  • Thirty days of searchable logs

Code

<!-- beam-border.free.js: download it from the Install section below and host it with your site -->
<script src="/beam-border.free.js" defer></script>

<beam-border speed="6" radius="24" theme="light" style="max-width: 360px">
  <h3>Team</h3>
  <p>$24 per seat, monthly</p>
</beam-border>

In context

Deploy previewsPoint at the card. The beam starts where it last stopped.
Only on hover or focus
Launch weekFive releases in five days, starting Monday.
Sunset, two beams Pro

Install · Free Web Component

One file, no dependencies. Aurora preset, every other option included. Host it yourself so your visitors never load anything from our servers.

1. Install with one command — or download the file
shadcn CLI · React
npx shadcn@latest add https://www.ui-design.co/r/beam-border.json
2. Load it and use the element
HTML
<!-- beam-border.free.js: download it from the Install section below and host it with your site -->
<script src="/beam-border.free.js" defer></script>

<beam-border speed="6" radius="20" theme="light" style="max-width: 360px">
  <h3>Team</h3>
  <p>$24 per seat, monthly</p>
</beam-border>
3. React + TypeScript (optional)

The shadcn command adds a typed React wrapper for you. Using the file directly? Custom elements work in React as-is; for type checking add:

TypeScript
// beam-border.d.ts
declare namespace JSX {
  interface IntrinsicElements {
    'beam-border': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
      speed?: number | string;
      radius?: number | string;
      beams?: 1 | 2 | '1' | '2';
      hover?: boolean | '';
      theme?: 'light' | 'dark';
    };
  }
}

Pro · React + TypeScript Pro

One payment of $4.99, yours forever. Use it in unlimited personal and commercial projects; no resale.

  • React component with TypeScript types and the full source — the card content is ordinary children
  • Sunset, Mint and Mono tints for the beam, plus custom tints from Brand Fit
  • The vanilla Web Component with every tint, a demo page, README and license

Attributes & props

NameTypeDefaultDescription
children elements—The card content. The card sizes itself to it; set a width (and a height, if you need one) on the element.
speed number (s)6Seconds for one lap of the border.
radius number (px)20Corner radius of the card and of the path the beam follows. 999 makes a pill.
beams 1 | 21One comet, or two on opposite sides of the card.
hover booleanfalseThe beam fades in and runs only while the pointer is over the card or something inside it has focus; otherwise it waits where it stopped.
theme 'light' | 'dark''light'A white card with a deep-coloured beam, or a dark card with a white-hot one.
tint Pro'aurora' | 'sunset' | 'mint' | 'mono' | object'aurora'The three colours along the tail, or a custom tint. Free build ships Aurora only.
--bb-pad CSS length22pxPadding inside the card.

Most border beams rotate a gradient behind a mask, so the light crawls along the long sides of a wide card and whips round the short ones. This one is a stack of dashes on the border path itself, moved by a single CSS animation: the same speed and the same tail on every side, at any proportion. The script only measures the card (a ResizeObserver) and pauses the animation while it is off-screen. The glow is a blurred copy that lies outside the card and is never clipped. With reduced motion the beam stands still on the top edge.

More components