Customize
Theme
0.70
1.0
1.0
0.05
1.0
Installation
Installs are paused for now. You can still preview and customize every component on its page.
Usage
import { GrainCube } from "@/components/grain-cube";
<div className="w-64">
<GrainCube theme="green" />
</div>It fills the width of its parent as a square. Drag it to spin.
For your own palette, pass 2 to 8 colors.
<GrainCube colors={["#52c4dc", "#f2f6ea", "#25e15f", "#0b5a2b"]} />It pauses when off screen and shows a still gradient if WebGL is not available.
Props
PropType
Your own palette of 2 to 8 colors. Overrides theme.
Cube size inside the box, from 0.2 to 1.
Default
0.7Zoom of the pattern on each face.
Default
1How much the pattern swirls.
Default
1Default
0.05Default
trueDefault
1Lets you drag to spin.
Default
trueRender scale, from 0.5 to 1.
Default
1