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

Spotlight

spotlight

Adds a theme-aware radial glow behind foreground content.

Usage

Basic usage

The parent container relative, Spotlight is used as the background layer, and the content is superimposed on it with relative z-10. Default top brand glow.

The content is superimposed on it
tsx
<div className="relative ...">
  <Spotlight />
  <div className="relative z-10">...content...</div>
</div>

Glow position

x/y locates the glow center, intensity adjusts the brightness - the strong glow in the upper left corner is x="20%", increase intensity.

The content is superimposed on it
tsx
<div className="relative ...">
  <Spotlight x="20%" intensity={18} />
  <div className="relative z-10">...content...</div>
</div>

Semantic Color Glow

color Connect any CSS color/variable, and change it to the success color to create a hero/empty status background for positive feedback.

The content is superimposed on it
tsx
<div className="relative ...">
  <Spotlight color="var(--color-success)" y="50%" size="100%" intensity={16} />
  <div className="relative z-10">...content...</div>
</div>

Gathering Glow

fade The smaller the glow, the more concentrated it is - it can be used as a partial accent light for pop-up windows/cards in conjunction with the centered position.

The content is superimposed on it
tsx
<div className="relative ...">
  <Spotlight y="50%" size="80%" intensity={20} fade={40} />
  <div className="relative z-10">...content...</div>
</div>

Over a texture (transparent fade, ellipse)

blend="transparent" fades into transparency instead of the background, so the dot texture underneath stays visible; two values in size give an elliptical glow.

The content is superimposed on it
tsx
<div className="relative isolate ...">
  <DotPattern className="-z-10" />
  <Spotlight blend="transparent" size="50% 60%" x="30%" intensity={18} fade={70} className="-z-10" />
  <div>…content…</div>
</div>

When to Use

Add a soft radial glow to the Hero/Card (focuses the eye, creates atmosphere). If you want to glow, use this component; if you want to regularize the texture, use DotPattern / GridPattern / StripedPattern.

Import

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

Props

NameTypeDefaultDescription
colorstringvar(--color-primary)Glow color; any CSS color/variable can be passed (such as var(--color-success))
intensitynumber14Center-color percentage used by color-mix; higher values make the glow brighter
xstring"50%"Glow Center X Position
ystring"0%"Glow center Y position (top)
sizestring"125%"Glow size (radial gradient range): one value is a circle, two values ("60% 70%", width height) are an ellipse
fadenumber55The percentage of the position where the background fades out. The smaller the glow, the more concentrated it is
blend"bg" | "transparent""bg"What the glow fades into: bg fades into the page background (the layer itself is opaque); transparent fades into transparency, for layering over DotPattern, images, or other textures without hiding them
Inherited from ComponentPropsWithoutRef<"div">.

Usage Guidelines

  • The internal absolute inset-0 fills the parent and must be placed inside the relative (and usually overflow-hidden) positioning container; the overlay content must be relative z-10 to cover the glow.
  • Customize color using the token variable (var(--color-*), which must be prefixed with --color-) instead of bare var(--primary), otherwise color-mix will not parse it.

Related

DotPattern · GridPattern · StripedPattern · RetroGrid · Ripple · Meteors

Playground

The content is superimposed on it
<div className="relative">
  <Spotlight intensity={14} fade={55} />
  <div className="relative z-10">...content...</div>
</div>
PreviousStripedPatternDecorationNextFadeMask

On this page

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