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

MagicRings

magic-rings

Draws layered reactive rings that follow and frame the pointer.

Usage

Basic usage

Put relative + overflow-hidden into the dark container, MagicRings is covered with absolute inset-0.

tsx
<div className="relative h-64 overflow-hidden rounded-xl bg-neutral-950">
  <MagicRings className="absolute inset-0" />
</div>

Dense Ring · Slow

ringCount increases the number of layers, speed reduces the speed, and radiusStep tightens the ring spacing to obtain wallpaper-level dense rings.

tsx
<MagicRings
  className="absolute inset-0"
  ringCount={9}
  speed={0.5}
  radiusStep={0.07}
/>

Two-color with petal split

color/colorTwo sets the inner and outer colors, and the ring color is interpolated according to the layer; ringGap enlarges the angular crack to form a petal shape.

tsx
<MagicRings
  className="absolute inset-0"
  color="var(--color-chart-3)"
  colorTwo="oklch(0.72 0.22 30)"
  ringGap={2.2}
  attenuation={8}
/>

Mouse Parallax · Click Burst

followMouse enables parallax following, clickBurst allows clicks to briefly zoom in and out, and hoverScale controls hover zoom.

Move the mouse to create parallax · Click to trigger the burst
tsx
<MagicRings
  className="absolute inset-0"
  followMouse
  clickBurst
  hoverScale={1.25}
/>

When to Use

As a whole decorative background, it renders concentric halo ripples (two-color interpolation) that continuously expand and fade out, suitable for login page/hero/empty status shading. For a pouring volumetric laser, use LaserFlow, and for a border streamer surrounding a single element, use BorderBeam; this component is a "radial diffusion ripple" atmosphere layer. It is recommended that className="absolute inset-0" fill the parent container.

Import

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

Props

NameTypeDefaultDescription
colorstringvar(--color-chart-1)Inner circle starting color, light and dark theme; any CSS color string can be used
colorTwostringvar(--color-chart-4)The outer ring termination color, the halo color is linearly interpolated according to the number of layers between color→colorTwo
speednumber1Animation-speed multiplier; higher values expand the rings faster
ringCountnumber6Number of simultaneous rings, clamped to 1-10
attenuationnumber10Ring attenuation; higher values produce sharper, shorter-lived rings, while lower values are more diffuse
lineThicknessnumber2Loop thickness magnification
baseRadiusnumber0.35Innermost circle starting radius (normalized to approximately 0-1)
radiusStepnumber0.1Increasing step size of the starting radius of two adjacent circles
scaleRatenumber0.1The expansion range of the inner ring radius in a single life cycle
opacitynumber1Overall opacity, overlaid on luminance-derived alpha
blurnumber0CSS blur radius (px), >0 add filter:blur to the canvas
noiseAmountnumber0.1Grain noise intensity, 0=clean
rotationnumber0Overall rotation angle (degrees)
ringGapnumber1.5Width of angular gaps in each ring; higher values create deeper, more petal-like cuts
fadeInnumber0.7Single loop fade-in ratio (early stage of life cycle)
fadeOutnumber0.5Single loop fade-out starting point ratio (late period of life cycle)
followMousebooleanfalseThe halo follows the mouse displacement to generate parallax
mouseInfluencenumber0.2The influence coefficient of the mouse on the overall displacement when followMouse
hoverScalenumber1.2Overall zoom target value on hover
parallaxnumber0.05Parallax dislocation coefficient of each layer with mouse
clickBurstbooleanfalseClick burst (shortly enlarge + brighten when clicked)
classNamestring-Additional class name for the root container or fallback div

Usage Guidelines

  • WebGL (ogl) component, cleanup and loseContext under React StrictMode dual mounting will poison the canvas reuse and cause it to go blank. A new canvas should be created internally every time it is mounted, see [[webgl-canvas-loseContext-poisons-strictmode-remount]].
  • The parent container must be relative + dark background, and the halo should be filled with absolute inset-0.
  • With reduced motion or without WebGL, the component falls back to static concentric rings; do not rely on the expansion animation.

Related

BorderBeam · ShineBorder · GlareHover · Lens · AnimatedBeam · OrbitingCircles

Playground

<div className="relative h-64 overflow-hidden rounded-xl"
     style={{ background: "oklch(0.14 0.02 280)" }}>
  <MagicRings
    className="absolute inset-0"
    ringCount={6}
    speed={1}
    attenuation={10}
    ringGap={1.5}
    blur={0}
    followMouse={false}
    clickBurst={false}
  />
</div>
PreviousLaserFlowDecorationNextMagnet

On this page

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