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

Grainient

grainient

Blends three warped color fields with animated film grain and contrast controls.

Usage

Basic usage

Eats chart token three colors by default, comes with absolute inset-0 z-0; put it into the relative container and it will be filled.

Content layer
tsx
<div className="relative h-56 overflow-hidden rounded-xl bg-neutral-950">
  <Grainient />
  <div className="relative z-10 flex h-full items-center justify-center text-white/85">
    Content layer
  </div>
</div>

Pure gradient (no particles)

grainAmount={0} Turns off film grain, resulting in a clean, gamut-distorted color field.

tsx
<Grainient grainAmount={0} timeSpeed={0.18} />

Heavy grain film feel

grainAmount Turn up + grainAnimated to make grain flicker over time, creating film noise.

tsx
<Grainient grainAmount={0.22} grainAnimated contrast={1.7} />

Customized three colors + zoom view

color1/2/3 Pass any CSS color. The smaller the zoom, the wider the color field range you can see.

tsx
<Grainient
  color1="oklch(0.82 0.16 70)"
  color2="oklch(0.62 0.2 30)"
  color3="oklch(0.32 0.06 300)"
  zoom={1.3}
  timeSpeed={0.35}
/>

When to Use

Use it for a calm, flowing three-color gradient with a pronounced film-grain texture behind a hero, sign-in page, empty state, or card. Use GradientBlinds for slats and a spotlight, Ferrofluid for liquid-metal ridges, or DotPattern for static geometry. Grainient stays subdued enough to support large areas of foreground text.

Import

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

Props

NameTypeDefaultDescription
timeSpeednumber0.25Animation-speed multiplier; 0 produces a static gradient
colorBalancenumber0Three-color bias; negative values favor color3 and positive values favor color1
warpStrengthnumber1Inverse warp control: higher values restrain distortion; 0.3-3 is recommended
warpFrequencynumber5Frequency of the sinusoidal domain warp, controlling wrinkle density
warpSpeednumber2Domain distortion drift speed over time
warpAmplitudenumber50Base domain-warp amplitude, combined with warpStrength
blendAnglenumber0Axis angle for the three-color blend, in degrees
blendSoftnessnumber0.05Softness of color-band transitions
rotationAmountnumber500Maximum noise-driven rotation in degrees
noiseScalenumber2Rotation-noise scale; higher values create finer variation
grainAmountnumber0.1Film-grain intensity; 0 produces a clean gradient
grainScalenumber2Grain sampling scale, controlling density
grainAnimatedbooleanfalseAnimate the grain over time; static grain costs less to render
contrastnumber1.5Contrast applied around middle gray
gammanumber1Gamma correction, <1 to brighten, >1 to darken
saturationnumber1Saturation, 0=grayscale, >1 to enhance
centerXnumber0Horizontal viewport-center offset used for framing
centerYnumber0Vertical viewport-center offset used for framing
zoomnumber0.9View zoom; lower values reveal more of the color field
color1string--color-chart-1Gradient first color (bright end), any CSS color
color2string--color-chart-2Gradient second color (main color/middle section)
color3string--color-chart-4Gradient third color (dark end)
classNamestring-Root container, includes absolute inset-0 z-0

Slots

SlotTypeDescription
fallbackReactNodeStatic gradient content for SSR, reduced motion, or unavailable WebGL

Usage Guidelines

  • OGL/WebGL renders on the client. SSR and unavailable WebGL show the static gradient fallback.
  • The root uses absolute inset-0 z-0; place it in a relative container and keep foreground content above it with relative z-10.
  • Enabling grainAnimated recalculates grain every frame. Keep the default static grain for persistent, full-area backgrounds when possible.
  • warpStrength is inverse: increasing it restrains the distortion instead of amplifying it.

Related

DotPattern · GridPattern · StripedPattern · Spotlight · RetroGrid · Ripple

Playground

Grainient
<div className="relative h-56 overflow-hidden rounded-xl bg-neutral-950">
  <Grainient
    timeSpeed={0.25}
    grainAmount={0.1}
    zoom={0.9}
    contrast={1.5}
    grainAnimated={false}
  />
</div>
PreviousGradientBlindsDecorationNextGridDistortion

On this page

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