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

LetterGlitch

letter-glitch

Animates a terminal-style character matrix with randomized glyph and color glitches.

Usage

Basic usage

Put it into the relative dark container, and the components will be filled with the chart token palette by default.

tsx
<div className="relative h-56 overflow-hidden rounded-xl"
     style={{ background: "oklch(0.14 0.02 255)" }}>
  <LetterGlitch className="absolute inset-0" />
</div>

Hard cutting failure feeling

smooth=false turns off frame-by-frame interpolation, character colors are cut hard, and the glitch is more blunt.

tsx
<div className="relative h-56 overflow-hidden rounded-xl"
     style={{ background: "oklch(0.14 0.02 255)" }}>
  <LetterGlitch className="absolute inset-0" smooth={false} glitchSpeed={40} />
</div>

Center Vignette + Placed Content

centerVignette Darken the contrast overlay copy in the middle and turn off outerVignette.

GLITCH

tsx
<div className="relative h-56 overflow-hidden rounded-xl"
     style={{ background: "oklch(0.14 0.02 255)" }}>
  <LetterGlitch className="absolute inset-0" outerVignette={false} centerVignette />
  <div className="pointer-events-none absolute inset-0 flex items-center justify-center">
    <p className="text-lg font-semibold tracking-widest text-white">GLITCH</p>
  </div>
</div>

Custom color palette (terminal green/cyan)

glitchColors passes any CSS color array, and off-screen canvas parses and interpolates.

tsx
<div className="relative h-56 overflow-hidden rounded-xl"
     style={{ background: "oklch(0.14 0.02 255)" }}>
  <LetterGlitch
    className="absolute inset-0"
    glitchColors={[
      "var(--color-chart-2)",
      "oklch(0.78 0.18 160)",
      "oklch(0.7 0.14 220)",
    ]}
    glitchSpeed={70}
  />
</div>

When to Use

Use it for a hacker-terminal or Matrix-style field of glitching characters. Use DotPattern for static geometric dots, or GridPattern for a regular line grid. LetterGlitch is a Canvas 2D character matrix built around rapidly changing glyphs and colors.

Import

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

Props

Extends HTMLAttributes<HTMLDivElement> except for color, forwarding native attributes such as id and event handlers.
NameTypeDefaultDescription
glitchColorsstring[]["var(--color-chart-2)", "var(--color-chart-1)", "var(--color-chart-4)"]Character flicker palette, any CSS color, internal off-screen canvas parsed to RGB interpolation
glitchSpeednumber50Minimum interval between updates in milliseconds; lower values feel more frantic, with 20-200 recommended
smoothbooleantrueInterpolate color changes frame by frame; false switches colors immediately for a harsher glitch
outerVignettebooleantrueOuter edge vignetting (radial fade around)
centerVignettebooleanfalseCenter vignetting (dark in the middle→transparent at the edge), used to contrast the embedded content
charactersstringUppercase letters + symbols + numbersCharacter set that participates in flickering, internally split by code points, supports any Unicode
classNamestring-Root container className
styleCSSProperties-Forward the root container inline style

Usage Guidelines

  • Canvas 2D renders on the client, so SSR may produce an empty first frame. Reduced-motion users receive the static state.
  • The character matrix only has a terminal look on a dark background, and light-colored containers have poor contrast.
  • CSS variables in glitchColors require the --color- prefix. Bare values such as var(--primary) do not resolve; see [[hulian-token-color-var-needs-color-prefix]].

Related

DotPattern · GridPattern · StripedPattern · Spotlight · RetroGrid · Ripple

Playground

<div className="relative h-56 overflow-hidden rounded-xl"
     style={{ background: "oklch(0.14 0.02 255)" }}>
  <LetterGlitch
    className="absolute inset-0"
    glitchSpeed={50}
    smooth={true}
    outerVignette={true}
    centerVignette={false}
  />
</div>
PreviousHyperspeedDecorationNextLightfall

On this page

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