Liquid Ocean
A mesmerizing Three.js animated ocean scene featuring flowing waves, floating boxes, and a rotating camera. Built with React Three Fiber, replicating the “Little Boxes” experiment.
Loading Preview...
Install using CLI
npx shadcn@latest add "https://www.vengenceui.com/r/liquid-ocean.json"Install Manually
1
Install dependencies
2
Add util file
lib/utils.ts
3
Copy the source code
Copy the code below and paste it into components/ui/liquid-ocean.tsx
Usage
Examples
Minimal Ocean (No Boats, No Grid)
Loading Preview...
Cyan Theme
Loading Preview...
Purple Theme
Loading Preview...
Sunset Theme
Loading Preview...
Matrix Theme
Loading Preview...
Calm Waters
Loading Preview...
High Detail Mode
Loading Preview...
Props
| Prop Name | Type | Default | Description |
|---|---|---|---|
| className | string | - | Additional CSS classes for the container. |
| backgroundColor | number | 0x000000 | Background color as hex number (e.g., 0x000000 for black). |
| accentColor | number | 0xF00589 | Accent color for ocean, boats, and lights (original pink). |
| gridColor | number | 0x333333 | Grid helper line color. |
| fov | number | 20 | Camera field of view. |
| rotationSpeed | number | 0.001 | Scene rotation speed per frame. |
| showGrid | boolean | true | Show the grid helper. |
| showBoats | boolean | true | Show floating boxes/boats. |
| boatCount | number | 5 | Number of floating boxes. |
| boatSpread | number | 5 | Spread range for floating boxes. |
| oceanSize | number | 25 | Ocean plane size. |
| oceanFragments | number | 25 | Ocean geometry subdivisions. Higher = more detail. |
| waveAmplitude | number | 0.2 | Maximum wave height. |
| waveSpeed | number | 0.05 | Wave animation speed multiplier. |
| showWireframe | boolean | true | Show wireframe overlay on ocean. |
| oceanOpacity | number | 0.85 | Ocean surface opacity (0-1). |
| children | React.ReactNode | - | Overlay content to display on top of the ocean. |
Features
3D Animated Ocean: Flowing wave animation with configurable speed and amplitude
Floating Boxes: Animated boxes that bob and tilt with the waves
Fully Customizable: Change colors, wave settings, boat count, and more
Multiple Themes: Create any color scheme with hex color props
React Three Fiber: Built with modern React 3D patterns for optimal performance
Overlay Support: Add any content on top of the ocean scene