Rubik Cube
An interactive 3D Rubik’s cube that rotates automatically and can be dragged to rotate manually.
Install using CLI
npx shadcn@latest add "https://obsidianui.dev/r/rubik-cube.json"Install Manually
1
Install dependencies
2
Add util file
Create a file lib/utils.ts:
3
Copy the source code
Copy the code into components/ui/rubik-cube.tsx
Usage
Props
| Prop Name | Type | Default | Description |
|---|---|---|---|
| mode | 'skeleton' | 'normal' | 'glass' | 'normal' | Visual style |
| dimensionMode | '2x2' | '3x3' | '4x4' | '3x3' | Cube size |
