Hulian UIv0.93.5413 components0 components
  • Start
  • Components
  • Blocks
  • Pages
  • Demos
  • Changelog
ChineseEnglish
  • ComponentsComponents
  • ThemeTheme

Backgrounds

  • DotPattern
  • GridPattern
  • StripedPattern
  • Spotlight
  • FadeMask
  • RetroGrid
  • Ripple
  • Meteors
  • Aurora
  • Particles
  • FlickeringGrid
  • WavyBackground
  • Silk
  • Iridescence
  • Threads
  • Orb
  • LiquidChrome
  • Balatro
  • Ballpit
  • Beams
  • ColorBends
  • DarkVeil
  • Dither
  • DotField
  • EvilEye
  • FaultyTerminal
  • Ferrofluid
  • FloatingLines
  • Galaxy
  • GradientBlinds
  • Grainient
  • GridDistortion
  • GridMotion
  • GridScan
  • Hyperspeed
  • LetterGlitch
  • Lightfall
  • Lightning
  • LightPillar
  • LightRays
  • LineWaves
  • LiquidEther
  • PixelBlast
  • PixelSnow
  • Plasma
  • PlasmaWave
  • Prism
  • PrismaticBurst
  • Radar
  • RippleGrid
  • ShapeGrid
  • SideRays
  • SoftAurora

Overlay Effects

  • BorderBeam
  • ShineBorder
  • GlareHover
  • Lens
  • AnimatedBeam
  • OrbitingCircles
  • ProgressiveBlur
  • CardSpotlight
  • Reveal
  • Antigravity
  • BlobCursor
  • ClickSpark
  • Crosshair
  • ElectricBorder
  • GhostCursor
  • GradualBlur
  • ImageTrail
  • LaserFlow
  • MagicRings
  • Magnet
  • MagnetLines
  • MetaBalls
  • MetallicPaint
  • OrbitImages
  • PixelTrail
  • PixelTransition
  • Ribbons
  • ShapeBlur
  • SplashCursor
  • StarBorder
  • StickerPeel
  • TargetCursor
  • Cubes
  • Tilt
  • BorderGlow
  • GlassIcons
  • GlassSurface
  • Lanyard
  • ModelViewer
  • FluidGlass

BorderBeam

border-beam

Moves a luminous beam along the border of a positioned element.

Usage

Basic usage

BorderBeam is the overlay of absolute inset-0. When placed in the relative + rounded + overflow-hidden container, a beam of light will be routed along the border. Default primary→chart-2 gradient.

Border Beam
tsx
<div className="relative h-40 w-72 overflow-hidden rounded-xl border border-border bg-surface">
  <div className="grid h-full place-items-center text-sm text-muted-foreground">Border Beam</div>
  <BorderBeam />
</div>

Reverse · Slow down

reverse makes the beam go around in the reverse direction, duration adjusts the seconds of one revolution, and size adjusts the length of the beam square.

Reverse
tsx
<BorderBeam reverse duration={10} size={80} />

Custom color

colorFrom / colorTo can be replaced with any CSS color or token, showing the brand color beam.

Custom Color
tsx
<BorderBeam colorFrom="var(--color-chart-3)" colorTo="var(--color-chart-5)" borderWidth={2} />

When to Use

Use it to run a compact colored highlight around a card or container border for emphasis, loading, or an active AI state. It is an absolutely positioned overlay and needs a relative container. Use ShineBorder for a continuous gradient around the whole border, AnimatedBeam to connect two elements, or GlareHover for a diagonal hover reflection.

Import

ts
import { BorderBeam } from "@hulianui/ui"

Props

NameTypeDefaultDescription
sizenumber50Beam square side length px (default demonstration uses 60)
durationnumber6Number of seconds for one round
delaynumber0Start delay seconds
colorFromstringvar(--color-primary)Beam start color
colorTostringvar(--color-chart-2)Beam stop color
reversebooleanfalseMove around the border in reverse
initialOffsetnumber0Starting offset 0-100
borderWidthnumber1border width px
classNamestring-Class name forwarded to the overlay
styleCSSProperties-Inline style forwarded to the overlay

Usage Guidelines

  • It must be placed in a position:relative container, and the container is generally overflow-hidden, otherwise the beam will go around the rounded corners and overflow.
  • The color prop needs to be prefixed with --color- when feeding the token (the default value is already included). The bare var(--primary) does not resolve - see [[hulian-token-color-var-needs-color-prefix]].
  • Renders nothing when the system prefers reduced motion. The beam is a purely decorative layer (absolute inset-0 pointer-events-none), so skipping it neither shifts layout nor drops information; freezing it mid-path would instead read as a rendering artifact.

Related

ShineBorder · GlareHover · Lens · AnimatedBeam · OrbitingCircles · ProgressiveBlur

Playground

Border Beam
<div className="relative">
  ...content
  <BorderBeam duration={6} size={60} />
</div>
PreviousLiquidChromeDecorationNextShineBorder

On this page

  • Usage
  • Documentation
    • When to Use
    • Import
    • Props
    • Usage Guidelines
    • Related
  • Playground