Interactions
Creative CanvasFree

Aquarium Prompt

An AI prompt box floating in a canvas pixel-art aquarium with schooling boids fish, interactive ripples, and rising thought bubbles.

Full-page view

Live preview

Interact with the effect here. Drag, hover, and use its controls.

What's on your mind?

Move through the water, or tap it.

Variation Tweaking

Adjust the options and see the preview update live.

26

Installation

Install automatically via CLI or manually integrate dependencies and code.

$npx @istmx/ui add aquarium-prompt

Usage

Import the component and configure visual variants, sizes, and operational states.

import { AquariumPrompt } from '@/components/interactions/aquarium-prompt'
 
<AquariumPrompt
title="What's on your mind?"
placeholder="Ask anything"
onSubmit={(text) => console.log(text)}
/>

Composition

Compose with icons, form triggers, and layout containers.

<div className="flex w-full items-center justify-center p-4">
<AquariumPrompt
title="Explore underwater AI"
placeholder="Type to attract fish..."
fish={26}
autoplay={false}
onSubmit={(query) => console.log(query)}
/>
</div>

API Reference

Property matrix, types, defaults, and usage descriptions.

PropTypeDefaultDescription
titlestring"What's on your mind?"Main heading text displayed above the prompt box.
placeholderstring"Ask anything"Input placeholder text.
fishnumber26Total count of schooling fish in the aquarium.
autoplaybooleanfalseEnables ghost pointer self-demonstration mode.
onSubmit(text: string) => voidundefinedCallback fired when prompt text is submitted.
classNamestring""Additional CSS classes for outer container.

Data Attributes

State-reflecting DOM attributes for custom selector styling.

This component does not expose custom data attributes. Standard HTML data attributes are forwarded to its interactive element.

How It Works

Renders a crisp pixel-art aquarium on a 4x downscaled HTML5 canvas. Fish follow a modified Craig Reynolds Boids algorithm (separation, alignment, cohesion) schooling with their species (clownfish, blue tang, yellow tang, sardines). The fish steer away from pointer coordinates, react to water ripples, and gather around the active typing caret. When a message is sent, the fish swarm inward to "gulp" the text, which floats away as an animated bubble.

Accessibility

A fully accessible form input with label association, keyboard Enter submission, and WCAG compliant focus ring styling.

Keyboard Navigation
EnterSubmit prompt message.
TabMove focus to input and submit button.

Limitations

•Requires HTML5 Canvas support.
•Boids computation scales with fish count; recommend fish <= 60 on mobile devices.

Features

•Pixel-art dithered water caustics with Bayer dithering matrix.
•Schooling Boids flocking physics for 4 fish species.
•Caret-following fish attraction while typing.
•Thought bubble float animation and ghost finger autoplay demo.
Credits

Meet the team behind the interaction

Crafted for modern web applications and AI agent workflows.

Aryan

Aryan

@istmX

Building high-performance interfaces, developer tooling, and autonomous agent workflows.

Helped by
Ella

Ella

UI/UX Designer

Crafting beautiful experiences.

Kenji

Kenji

WebGL & Shader Designer

Bringing visuals to life.

Sarah

Sarah

Motion Designer

Animating the details.