Skip to content
Thrum

Border beam

A light that travels round the border of a card, a button or an input, to mark the one thing that is new or recommended. It follows whatever corner radius its parent has. For a glow that answers the pointer instead, use the spotlight card.

Install

npx shadcn@latest add @thrum-pro/border-beam

This is a Pro component. The command works once your project has a licence key: set up Pro or see pricing.

Props

PropTypeDefaultDescription
durationnumberDefault 6Seconds for one lap of the border, at constant speed.
sizenumberDefault 140The length of the beam, in pixels. Its tail fades to nothing.
delaynumberDefault 0Start this many seconds into the lap. Give a second beam half the duration to put it on the opposite side.
borderWidthnumberDefault 2The width of the band the beam travels in, in pixels, just inside the parent's edge.
colorFromstringDefault "var(--chart-1)"The colour at the head of the beam, as any CSS colour. A theme variable keeps it right in both themes.
colorTostringDefault "var(--chart-2)"The colour the beam fades through towards its tail.
reversebooleanDefault falseTravel anticlockwise.
pausedbooleanDefault falseFreeze the beam where it is.
classNamestring–Extra classes for the band, merged last.
...propsComponentProps<"span">–Every other span attribute is passed through. The beam takes no children.

Motion and sound

Motion

  • The beam travels clockwise round the parent's edge, one lap every 6 seconds by default, at constant speed, and turns with each corner.
  • It moves along a CSS motion path: the edge of its own box, which takes the parent's corner radius. The parent and its content never move.
  • paused freezes it where it is. delay sets where it starts.
  • Reduced motion: no beam at all.

Sound

Silent. This component makes no sound.

Accessibility

  • The beam is decoration. It is hidden from screen readers with aria-hidden and takes no pointer events.
  • It sits inside the parent's border and never over the content, so it cannot lower the contrast of any text.
  • It does not say anything on its own. When it marks a recommended plan, say so in words too, such as a badge reading Recommended.
  • The parent needs position: relative. The beam fills it and takes its corner radius with border-radius: inherit.

Source

SourcePro

The source comes with Pro

TypeScript source · Copy-paste ready · MIT-compatible for client projects · Includes all dependencies

Files and dependencies

Adds
components/ui/border-beam.tsx
Packages
None
Brings along
Nothing

Changelog

  1. 1.0.0 · 2026-12-03First release.

Loading index…

Keyboard shortcuts

/Ctrl KSearch components, docs and actions
?Show this list
AAppearance studio
SSound on or off
MFull or reduced motion
TTheme: auto, light, dark
GSurface: solid or frosted
BBackdrop photograph (under glass)
CCorner radius: square to round
RReplay the demo, on a component page
DDraw new data, on a component page
←→HomeEndMove the cursor in a focused chart
EscClose a dialog, or leave a chart cursor