Inputs · Free
Bot avatar
A profile picture uploader: the Bot waits in a dashed circle, the photo lands like jelly, drag and pinch to crop, and Save gives a square JPEG, WebP or PNG.
Free on Gumroad: the download arrives in your inbox.
Details
- Category
- Inputs
- Plan
- Free
- Code
- React + Tailwind, TypeScript · 255 lines
- Files
- BotAvatar.tsx
- Needs
- The Bot (installed with it)
- Agents
- MCP server and shadcn registry
About
A profile picture uploader. Empty, it's the Bot in a dashed circle, watching your cursor. Drag a photo over it and the circle swells and the Bot's eyes widen. Drop it (or click and choose one) and it lands in the circle with a jelly squash. Drag to move it, scroll or pinch to zoom; the rest of the photo shows faded around the circle, so you see what's cut. Save gives your code the cropped image.
Install
With the shadcn CLI:
npx shadcn@latest add https://www.stackd.codes/r/bot-avatar.jsonOr let your agent add it through the StackD MCP server:
claude mcp add --transport http stackd https://www.stackd.codes/mcpPrompt for your agent
Paste it into Claude Code, Cursor, Codex or VS Code once the MCP server is connected.
Add the StackD Bot avatar component to this project. Use the StackD MCP server: call get_component with { "name": "bot-avatar" }, write the files at the paths it gives and install any npm packages it lists. Then use it where it fits, following its README for the props, and keep its own styles.What's inside
| File | What it is |
|---|---|
BotAvatar.tsx | The uploader |
Bot.tsx | The Bot in the empty circle |
Use
- Copy both files into the same folder of your project (for example
components/). - Use it:
import { BotAvatar } from './components/BotAvatar'
<BotAvatar
defaultSrc={user.avatarUrl}
onChange={async (img) => {
if (!img) return removeAvatar()
await uploadAvatar(img.blob) // a square JPEG, 512 px
}}
/>
img.url is a local URL you can show straight away while the upload runs.
In Next.js the files already start with 'use client'. In other React setups that line does nothing.
Options
| Prop | Default | What it does |
|---|---|---|
size | 180 | The circle's size in px |
defaultSrc | A picture to start with (a URL) | |
editOnStart | false | With defaultSrc, open it straight in the cropper |
onChange | Called with { blob, url } when Save is pressed, or null when the picture is removed | |
output | 512 | Size of the image you get, px (square) |
type | 'image/jpeg' | 'image/jpeg', 'image/webp' or 'image/png' |
maxMB | 10 | Largest file accepted |
theme | 'light' | 'light' or 'dark' |
className | Extra classes |
The image is square: show it round with CSS (border-radius: 50%), so you can also use it square elsewhere. A picture from another site needs CORS headers to be edited again (the browser won't let a canvas read it otherwise).
Works with
Mouse, touch (one finger moves, two pinch) and keyboard: Tab to the photo, arrows move it (Shift for bigger steps), + and − zoom, Enter saves. Files that aren't pictures or are too large get a short message. With reduced motion on, nothing squashes or bounces.





