Neon Mesh BG
A dark cinematic WebGL background with an evolving purple neon mesh, fine pixel matrix, and soft atmospheric bloom.
Installation#
pnpm dlx shadcn@latest add @davinciui/neon-mesh-bgUsage#
API Reference#
| Prop | Type | Default |
|---|---|---|
backgroundColorDeepest background color. | string | "#050505" |
primaryColorDark violet midtone. | string | "#40134e" |
secondaryColorElectric purple / magenta glow. | string | "#873491" |
highlightColorPale lavender core highlight. | string | "#eed5f2" |
scaleBase sampling frequency of the mesh field. | number | 1.6 |
complexityFBM octave count, 1 to 5. | number | 4 |
warpDomain-warp amplitude of the field. | number | 1.15 |
contrastField contrast around mid-gray. | number | 1.6 |
brightnessPost brightness multiplier. | number | 0.85 |
gridSizePixel cell size in screen pixels. Smaller values densify the matrix. | number | 6.5 |
gridStrengthVisibility of the pixel / dot matrix, 0 to 1. | number | 0.92 |
glowStrengthAtmospheric bloom strength, 0 to 2. | number | 1 |
glowSpreadSoftness of the glow falloff, 0 to 1. | number | 0.65 |
speedGlobal animation rate. | number | 0.35 |
animateSet to false to freeze the current composition. | boolean | true |
qualityBacking-store resolution multiplier, 0.25 to 1. Lower values are faster. | number | 1 |
pauseWhenOffscreenPause rendering while outside the viewport. | boolean | true |
respectReducedMotionRender one static frame for reduced-motion users. | boolean | true |
maxDprMaximum device pixel ratio for the backing buffer. | number | 2 |
classNameAdditional classes applied to the background layer. | string | — |
Accessibility#
The background is aria-hidden and pointer-events none, so it contributes no content or focus targets. A CSS radial-gradient fallback renders when WebGL is unavailable, and the component is safe behind foreground content.
Motion#
The WebGL ribbon evolves using speed and animate, pauses offscreen and when the tab is hidden, and respectReducedMotion defaults true so prefers-reduced-motion renders a single static frame. quality and maxDpr trade resolution for performance.
Known constraints#
- Requires WebGL. When the context is unavailable the host switches to a CSS gradient fallback automatically.
- Reduced motion freezes the shader instead of animating it.
- The canvas paints behind content, so the host needs an explicit height or a sized parent.
About Neon Mesh BG#
A dark, cinematic WebGL background with an evolving purple neon mesh viewed through a fine LED pixel matrix.
A softly bending wave carries shifting pools of violet and lavender light across a stationary square pixel grid. Smooth falloff keeps the edges atmospheric and the surrounding frame near black.
Use it as a full-screen hero backdrop, a card atmosphere, or a premium ambient layer behind interface content.
Controls#
- Scale changes the mesh from broad sweeping masses to tighter folds.
- Warp controls how hard the field folds and reforms over time.
- Contrast sets how much of the frame stays dark versus illuminated.
- Grid Size / Strength tune the fine pixel-matrix texture over the glow.
- Glow Strength / Spread shape the atmospheric bloom around the neon mass.
View source
Keep in mind
Need a custom component?
I build bespoke UI components & websites tailored to your brand.

