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

Balatro

balatro

Renders a pixelated swirling multicolor oil-paint shader background.

Usage

Basic usage

Put it into the relative container and it will be filled. The three colors will be chart token adaptive light and dark by default.

Balatro

Spiral oil paint WebGL background

tsx
<div className="relative h-64 overflow-hidden rounded-xl"
     style={{ background: "oklch(0.12 0.02 270)" }}>
  <Balatro />
  <div className="relative z-10">Content</div>
</div>

Continuous rotation

isRotate lets the vortex continue to rotate over time, and spinSpeed controls the turbulence speed.

isRotate

tsx
<Balatro isRotate spinSpeed={4} />

Retro Mosaic

Turn down pixelFilter to make the pixel blocks larger, creating a low-resolution mosaic texture.

pixelFilter = 120

tsx
<Balatro pixelFilter={120} contrast={4} />

Custom color matching

color1/2/3 can transfer any CSS color to create exclusive oil paint vortex.

Warm orange oil paint

tsx
<Balatro
  color1="oklch(0.72 0.2 40)"
  color2="oklch(0.6 0.18 25)"
  color3="oklch(0.18 0.04 30)"
  spinSpeed={5}
  lighting={0.6}
/>

When to Use

Use it for a full-bleed backdrop with dense painted color and a swirling flow, such as a sign-in page, hero, or card background. Use DotPattern or GridPattern for regular geometry, and Spotlight for a lightweight single-color glow. Balatro is a GPU-heavy focal effect, not a small decorative accent.

Import

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

Props

NameTypeDefaultDescription
spinRotationnumber-2.0Static vortex rotation when isRotate=false; the sign determines direction
spinSpeednumber7.0Internal paint-flow speed; higher values produce more vigorous motion
offset[number, number][0, 0]Vortex-center offset from the viewport midpoint as [x, y]
color1string--color-chart-1Main color for the vortex's bright band; accepts any CSS color and defaults to a theme-aware token
color2string--color-chart-2Secondary color for the middle of the vortex; accepts any CSS color
color3string--color-chart-5Background color for shadows and gaps in the swirl; accepts any CSS color
contrastnumber3.5Separation between the three colors; higher values create sharper boundaries
lightingnumber0.4Highlight intensity on vortex peaks; 0 disables the additional highlights
spinAmountnumber0.25Radial twist strength; higher values make the spiral tails more pronounced
pixelFilternumber745Pixelation factor; higher values produce smaller, finer pixels, while lower values create a coarser retro mosaic
spinEasenumber1.0Rotation easing coefficient used to fine-tune the overall twist and speed
isRotatebooleanfalseContinuously rotate over time; when enabled, spinRotation influences rotation speed
mouseInteractionbooleantrueEnable pointer interaction; disabling it makes the effect pointer-transparent
classNamestring-Additional class name for the root container or fallback div

Slots

SlotTypeDescription
fallbackReactNodeStatic non-WebGL content for reduced motion or unavailable WebGL; defaults to a conic-gradient swirl

Usage Guidelines

  • WebGL client rendering: the component depends on OGL and WebGL and must mount on the client. SSR renders the conic-gradient fallback; do not import the realtime implementation directly at the top of a Next.js server-component tree.
  • Token colors require the --color- prefix: pass CSS variables such as var(--color-chart-1). Bare names such as var(--chart-1) do not resolve and can make the vortex render black. See [[hulian-token-color-var-needs-color-prefix]].
  • Give the parent position: relative and overflow: hidden so the absolutely positioned effect fills the intended bounds without overflowing.
  • Continuous rotation and high lighting values increase GPU cost. Avoid stacking multiple instances in long lists, especially on lower-end devices.

Related

DotPattern · GridPattern · StripedPattern · Spotlight · RetroGrid · Ripple

Playground

Balatro · Spiral oil paint background

<div className="relative h-64 overflow-hidden rounded-xl"
     style={{ background: "oklch(0.12 0.02 270)" }}>
  <Balatro
    spinSpeed={7}
    contrast={3.5}
    lighting={0.4}
    pixelFilter={745}
    spinAmount={0.25}
    isRotate={false}
    mouseInteraction={true}
  />
  <div className="relative z-10">Content</div>
</div>
PreviousFluidGlassDecorationNextBallpit

On this page

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