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

ElectricBorder

electric-border

Animates noisy electric light around an element boundary.

Usage

Basic usage

Use ElectricBorder to wrap any content, and you will get a circle of electrified and beating borders.

Electric Border
tsx
<ElectricBorder borderRadius={16}>
  <div className="px-8 py-6 text-sm font-medium">Electric Border</div>
</ElectricBorder>

Speed and Chaos

speed controls the jitter speed, chaos controls the intensity of arc tearing.

Discharging
tsx
<ElectricBorder chaos={2} speed={2} borderRadius={20}>
  <div className="px-8 py-6 text-sm">Discharging</div>
</ElectricBorder>

Custom colors and rounded corners

color Eat any CSS color (it is recommended to use var(--color-...) token), set the maximum value for borderRadius to make a capsule.

tsx
<ElectricBorder color="var(--color-chart-3)" borderRadius={999} thickness={2}>
  <button type="button" className="px-6 py-3 text-sm font-semibold">
    Try it now
  </button>
</ElectricBorder>

Thick Halo Wrapped Card

thickness Enlarge the soft edge to make the glow more obvious, suitable for emphasizing key cards.

Hulian component library

Powered Bezel · Zero Dependence SVG Turbulence

tsx
<ElectricBorder thickness={3} chaos={1.4} borderRadius={14}>
  <div className="w-56 space-y-1 px-5 py-4">
    <p className="text-sm font-semibold">Hulian Component Library</p>
    <p className="text-xs opacity-60">Powered bezel · Zero dependence on SVG turbulence</p>
  </div>
</ElectricBorder>

When to Use

Wrap a piece of content (button, card, CTA) with an electric arc stroke that continuously discharges and beats to create a technological/cyber atmosphere. If you want a static soft light stroke, use ShineBorder; if you want a single-point surround streamer, use BorderBeam; this component is a powerful dynamic effect of "the entire edge is shaking and discharging", which is the most eye-catching but also the heaviest.

Import

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

Props

NameTypeDefaultDescription
colorstringvar(--color-primary)Current stroke color, light and dark theme. Any CSS color string can be used; the CSS variable feeding SVG stroke must be prefixed with --color- before parsing
speednumber1Current jitter speed multiplier, the larger the value, the faster the jitter (speed=1 ≈ 2s for one round <animate>)
chaosnumber1The degree of disorder (turbulence displacement intensity), the larger the stroke, the more violent it will be torn, mapping the scale of feDisplacementMap
thicknessnumber2The thickness of the soft edge of the frame (px)
borderRadiusnumber16Corner radius (px), applied to both container and current stroke
classNamestring-Root container additional className
styleCSSProperties-Forward the root container inline style

Slots

SlotTypeDescription
childrenReactNodeContent wrapped by current frame

Usage Guidelines

  • When customizing color, be sure to bring the --color- prefix (such as var(--color-chart-3)). Feeding bare var(--primary) to SVG stroke does not resolve, and the stroke will become black or disappear. See [[hulian-token-color-var-needs-color-prefix]].
  • The stroked arc requires a dark background to be visible, and the glow is almost invisible on a light background.

Related

BorderBeam · ShineBorder · GlareHover · Lens · AnimatedBeam · OrbitingCircles

Playground

Electric Border
<ElectricBorder
  speed={1}
  chaos={1}
  thickness={2}
  borderRadius={16}
>
  <div className="px-8 py-6">Electric Border</div>
</ElectricBorder>
PreviousCrosshairDecorationNextGhostCursor

On this page

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