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

ShapeGrid

shape-grid

Scrolls configurable geometric shapes endlessly with hover fills and fading trails.

Usage

Basic usage

The default grid scrolls infinitely to the right, and the side line eats --color-border token; canvas needs to be filled with absolute inset-0.

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

Shape and Orientation

shape Choose one of four (square / circle / triangle / hexagon), direction controls the scroll direction.

tsx
<ShapeGrid
  shape="hexagon"
  direction="diagonal"
  squareSize={32}
  className="absolute inset-0 opacity-90"
/>

Hover tailing

hoverTrailAmount>0 makes the hovering unit leave a fade trail, hoverFillColor specifies the fill color (try moving the mouse).

tsx
<ShapeGrid
  shape="circle"
  direction="up"
  hoverTrailAmount={6}
  hoverFillColor="var(--color-chart-2)"
  className="absolute inset-0 opacity-90"
/>

Triangle mesh · Warm fill

triangle is arranged in staggered shapes, speed is for faster scrolling, and hoverFillColor is for theme accent colors.

tsx
<ShapeGrid
  shape="triangle"
  direction="left"
  speed={1.5}
  hoverFillColor="var(--color-chart-3)"
  className="absolute inset-0 opacity-90"
/>

When to Use

Use it for a continuously panning geometric-cell background with pointer highlights, such as a kanban or landing-page surface. For a static dot pattern, use DotPattern; for a static line grid, use GridPattern. ShapeGrid uses Canvas 2D rather than WebGL and supports four cell shapes plus optional hover trails.

Import

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

Props

NameTypeDefaultDescription
direction"right"|"left"|"up"|"down"|"diagonal""right"Grid scroll direction
speednumber1Scrolling speed (pixels/frame, internal clamp lower limit 0.1); forced stillness under reduced-motion
borderColorstringvar(--color-border)Cell edge color, any CSS color string
squareSizenumber40Unit side length (px), also determines the mesh density
hoverFillColorstringvar(--color-primary)Cell fill color on hover, fade in/out easing
shape"square"|"circle"|"triangle"|"hexagon""square"Element shape
hoverTrailAmountnumber0Hover trailing length (how many historical units are retained to fade out), 0 = no trailing
classNamestring-Passthrough to root canvas
styleCSSProperties-Inline styles passed through to the root canvas

Usage Guidelines

  • It is a canvas itself and does not have absolute inset-0. It must be filled with className positioning (absolute inset-0 in the example); the parent container must have positioning + size + overflow-hidden.
  • The color token fed to the canvas must be prefixed with --color- (such as var(--color-chart-2)). If bare var(--primary) is not parsed, see [[hulian-token-color-var-needs-color-prefix]].
  • In reduced-motion, the speed is treated as 0 (still), and the motion effect should not be used as key feedback.

Related

DotPattern · GridPattern · StripedPattern · Spotlight · RetroGrid · Ripple

Playground

<div className="relative h-56 overflow-hidden rounded-xl"
     style={{ background: "oklch(0.16 0.02 255)" }}>
  <ShapeGrid
    shape="square"
    direction="right"
    speed={1}
    squareSize={40}
    hoverTrailAmount={0}
    className="absolute inset-0 opacity-90"
  />
</div>
PreviousRippleGridDecorationNextSideRays

On this page

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