Ink Canvas
Web (React)
Drag to paint swirling ribbons of ink through a live fluid simulation.
An interactive fluid canvas: drag the cursor to paint ribbons of ink that keep swirling after you let go, with a soft glow. It fills its positioned parent. It only moves in response to the cursor, so it has no autoplaying motion. Built on the shaders library (MIT) and rendered with WebGPU.
Drag to paint
Installation
CLI
npx @modus-ui/cli add ink-canvasManual
- Install
shaderswithnpm install shaders. - Copy the code from the component tab.
- Create a file at
components/ui/ink-canvas.tsx. - Paste the code.
Usage
tsx
Props
| Prop | Type | Default | Description |
|---|---|---|---|
backgroundColor | string | "#07070b" | Canvas colour. |
colorMode | "rainbow" | "single" | "rainbow" | rainbow cycles hues; single uses color. |
color | string | "#ff2d7e" | Ink colour when colorMode is single. |
radius | number | 1 | Brush radius. |
curl | number | 0.5 | Amount of curl in the flow. |
decay | number | 0.6 | How quickly the ink fades. |
glow | number | 0.4 | Glow intensity. |
Comments