BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/wise-ui/metallic-lava

Metallic Lava

wise-ui/metallic-lava
FreeComponent

An animated metallic lava background using WebGL shaders.

Live preview

live · rendered by the registry
Rendered by wise-ui on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://wise-ui.com/r/metallic-lava.json

Source

registry/wise-ui/components/metallic-lava.tsxwise-ui.com/r/metallic-lava.json · first 6 KB
1"use client"
2
3import * as React from "react"
4import { cn } from "@/lib/utils"
5
6interface MetallicLavaProps extends React.HTMLAttributes<HTMLDivElement> {
7 /** Base metallic color */
8 color?: string
9 /** Highlight/specular color */
10 highlightColor?: string
11 /** Animation speed multiplier (1 = default) */
12 speed?: number
13 /** Number of lava blobs */
14 blobCount?: number
15 /** Visual mode - "dark" renders light blobs on dark, "light" inverts */
16 mode?: "dark" | "light"
17}
18
19const MetallicLava = React.forwardRef<HTMLDivElement, MetallicLavaProps>(
20 (
21 {
22 color = "#8a9bae",
23 highlightColor = "#c5d0dc",
24 speed = 1,
25 blobCount = 28,
26 mode = "dark",
27 className,
28 children,
29 ...props
30 },
31 ref
32 ) => {
33 const canvasRef = React.useRef<HTMLCanvasElement>(null)
34 const containerRef = React.useRef<HTMLDivElement>(null)
35
36 React.useImperativeHandle(ref, () => containerRef.current!)
37
38 React.useEffect(() => {
39 const canvas = canvasRef.current
40 const container = containerRef.current
41 if (!canvas || !container) return
42
43 const ctx = canvas.getContext("2d")
44 if (!ctx) return
45
46 // Padding around canvas for blur/contrast filter - prevents edge artifacts
47 const PAD = 80
48 let w = 0
49 let h = 0
50 let rafId = 0
51
52 interface Blob {
53 x: number
54 y: number
55 rx: number
56 ry: number
57 rotation: number
58 rotSpeed: number
59 vx: number
60 vy: number
61 phase: number
62 freq: number
63 ampX: number
64 ampY: number
65 pulsePhase: number
66 pulseSpeed: number
67 numPoints: number
68 offsets: number[]
69 }
70
71 let blobs: Blob[] = []
72
73 function initBlobs() {
74 // Distribute blobs in a jittered grid for even coverage
75 const cols = Math.max(1, Math.ceil(Math.sqrt(blobCount * w / h)))
76 const rows = Math.max(1, Math.ceil(blobCount / cols))
77 const cellW = w / cols
78 const cellH = h / rows
79
80 blobs = Array.from({ length: blobCount }, (_, i) => {
81 const col = i % cols
82 const row = Math.floor(i / cols)
83 const baseSpeed = 0.12 + Math.random() * 0.35
84 const angle = Math.random() * Math.PI * 2
85 const baseR = 50 + Math.random() * 120
86 const stretch = 0.5 + Math.random() * 1.0
87 const numPoints = 8 + Math.floor(Math.random() * 5)
88 const offsets = Array.from(
89// … truncated

What it pulls in

npm packages

  • clsx
  • tailwind-merge

Files it writes

  • registry/wise-ui/components/metallic-lava.tsx

Facts

Registry
wise-ui
Type
registry:component
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-02
Last confirmed
yesterday

Go to the source

Docs on wise-ui wise-ui.com r-pathak/wise-ui on GitHub Raw registry item This item as JSON

More from wise-ui

All 20 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Animated Tabsanimated-tabswise-uiComponentsFree3 deps
Border Beamborder-beamwise-uiComponentsFree3 deps
Data Tabledata-tablewise-uiComponentsFree3 deps
Dockdockwise-uiComponentsFree3 deps
Dot Matrixdot-matrixwise-uiComponentsFree2 deps
Editable Texteditable-textwise-uiComponentsFree4 deps
Gradient Sidebargradient-sidebarwise-uiComponentsFree3 deps
Kanban Boardkanban-boardwise-uiComponentsFree6 deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex