Border Beam
React component that draws an animated traveling or breathing glow around any element
Tier A · StrongAnimation LibraryComponent Librarybeam.jakubantalik.com

Border Beam is a single zero-dependency React component, published to npm as border-beam (v1.3.0, MIT). You wrap any element in <BorderBeam> and it overlays an animated glow, auto-detecting the child's border-radius. Five size presets split into two families: rotate (sm, md, line) drives a conic-gradient beam masked to the border via CSS @property keyframes, and pulse (pulse-inner, pulse-outside) breathes from a single shared frame-rate-capped requestAnimationFrame loop that writes plain CSS custom properties. Four color variants (colorful, mono, ocean, sunset), three themes (dark, light, auto), plus strength, duration, brightness, saturation, hueRange, staticColors, borderRadius, active and onActivate/onDeactivate callbacks. This site is the live demo; it is a Vite SPA whose served HTML is an empty shell.
npm install border-beamFor an agent
Reach for this instead of hand-rolling a Magic-UI-style border beam: it is a real npm package with zero dependencies and react>=18 as its only peer, so it composes with shadcn/ui and Tailwind without adding framer-motion. Two traps are documented and both bite: pulse-outside renders behind the child at z-index -1 and needs an opaque child plus overflow room in the parent, and it borrows the child's own 1px border as the idle hairline, so give the child a border or an inset box-shadow. Also gate the rotate presets yourself — only the pulse presets ship a prefers-reduced-motion block — and expect stepped rather than smooth motion on browsers without CSS @property (pre-Chrome 85, pre-Safari 15.4, pre-Firefox 128).
Why it is here. The glowing-border effect is everywhere in AI product UI and is usually copy-pasted badly; this packages it properly, with reduced-motion handling, a shared rAF loop and honest degradation notes.
Facts
- License
- MIT
- Pricing
- Free, Open source
- Framework
- React
- Styling
- Vanilla CSS, CSS custom properties
- Distribution
- npm package, GitHub repository
- Platform
- Web
- Content type
- Code
- Agent readiness
- CLI installable, Readable open source, Client-rendered shell
- Accessibility
- Honors reduced motion, Known accessibility gaps
- Maturity
- Actively maintained
- GitHub stars
- 1,991
- Package
- border-beam
Components it ships
1 totalHelps you build
2Notable for
- 5 presets across rotate and pulse families
- 4 color variants
- zero dependencies, react>=18 peer only
- shared 30fps rAF pulse driver
- auto-detects child border-radius
Provenance
Verified 2026-08-15. HTTP 200. https://beam.jakubantalik.com (200, 3.4KB Vite shell + meta tags, /assets/main-CHM1__fq.js inspected), raw packages/border-beam/README.md, registry.npmjs.org/border-beam
Also in Motion & Interaction
6- GSAP · JavaScript animation engine with 19 plugins, now free for commercial use
- Lenis · Smooth-scroll engine that keeps native scroll and honours reduced-motion
- Motion · Hybrid JS/React/Vue animation engine with springs, layout and scroll animation
- NumberFlow · Dependency-free animated number component for React, Vue, Svelte and JS
- React Bits · 234 copy-paste animated React components: text effects, cursors, WebGL backgrounds
- React Native Reanimated · UI-thread animation library for React Native, v4 on the New Architecture