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

RetroGrid

retro-grid

Animates a perspective grid toward the viewer for a retro backdrop.

Usage

Basic usage

relative Place a layer of RetroGrid in the container to get a perspective scrolling grid, with a default tilt angle of 65°, 12s round, and text-border.

tsx
<div className="relative h-56 w-full overflow-hidden rounded-xl border border-border bg-surface">
  <RetroGrid />
</div>

Mig · Slow

cellSize adjusts the grid density, and duration adjusts the rolling period (the larger it is, the slower it is).

tsx
<div className="relative h-56 w-full overflow-hidden rounded-xl border border-border bg-surface">
  <RetroGrid cellSize={36} duration={24} />
</div>

Color change and transparency

Set the thread color to currentColor, use text-* to change the color; opacity adjusts the overall fade-in level.

tsx
<div className="relative h-56 w-full overflow-hidden rounded-xl border border-border bg-surface">
  <RetroGrid className="text-primary" opacity={0.7} />
</div>

When to Use

Perspective scrolling grid horizon creating a synthwave/cyberpunk vibe. If you want a dynamic perspective grid, use this component; if you want a static tile grid, use GridPattern, and if you want a dotted grid, use DotPattern.

Import

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

Props

NameTypeDefaultDescription
anglenumber65Perspective tilt angle (degrees)
cellSizenumber60Grid unit pixels
opacitynumber0.5Overall opacity
durationnumber12Duration of one scroll cycle in seconds; higher values move more slowly
Inherited from ComponentPropsWithoutRef<"div">. The color is currentColor and controlled by the text-* tool class.

Usage Guidelines

  • The inner absolute inset-0 is parented and must be placed inside a relative (and usually overflow-hidden) positioning container.
  • The CSS scrolling animation honors prefers-reduced-motion and stops when the system requests reduced motion.

Related

DotPattern · GridPattern · StripedPattern · Spotlight · Ripple · Meteors

Playground

<div className="relative">
  <RetroGrid cellSize={60} duration={12} opacity={0.5} />
</div>
PreviousFadeMaskDecorationNextRipple

On this page

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