
Buttons · Free
Squeeze button
Words in ink blocks that squeeze each other on hover; click and they slide into one block with the Bot saying Sent.
Free on Gumroad: the download arrives in your inbox.
Details
- Category
- Buttons
- Plan
- Free
- Code
- React + Tailwind, TypeScript · 310 lines
- Files
- SqueezeButton.tsx
- Needs
- The Bot (installed with it)
- Agents
- MCP server and shadcn registry
About
A button made of words, each in its own ink block, side by side, and one block holds the Bot. Move over a block and it swells while the others get squeezed. A block squeezed thinner than its word turns the word on its side, and the Bot shrinks with its block. The last block is round: a circle at rest, a pill when it swells.
Click it and the blocks run together like ink. The Bot pops out smiling with "Sent", and after a moment it splits back into the words. If your action fails, the blocks shake and come apart.
React + Tailwind and the Bot, no other libraries. One real button, so it works with the keyboard and screen readers, and it respects reduced motion.
Install
With the shadcn CLI:
npx shadcn@latest add https://www.stackd.codes/r/squeeze-button.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 Squeeze button component to this project. Use the StackD MCP server: call get_component with { "name": "squeeze-button" }, 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.Use
- Copy
SqueezeButton.tsxandBot.tsxinto the same folder (for examplecomponents/). - Use it:
import { SqueezeButton } from './components/SqueezeButton'
<SqueezeButton onClick={sendMessage} />
<SqueezeButton
words={['Say', 'hello']}
botAt={2}
label="Say hello"
doneLabel="Hi!"
theme="dark"
onClick={async () => {
await fetch('/api/contact', { method: 'POST' })
}}
/>
If onClick returns a promise, the Bot waits for it: resolve and it says doneLabel, throw and the blocks shake and come apart.
This Bot.tsx has the newest Bot (nine shapes, and it squashes when clicked). If you already use the Bot from StackD, replace it with this one; everything else stays the same.
In Next.js the files already start with 'use client'. In other React setups that line does nothing.
Options
| Prop | Default | What it does |
|---|---|---|
words | ['Keep', 'touch'] | The words, one block each |
botAt | 1 | Where the Bot's block goes among the words (0 = first). -1: no Bot block |
label | 'Keep in touch' | What a screen reader says |
onClick | Your action. Return a promise to make the Bot wait for it | |
doneLabel | 'Sent' | Shown with the Bot when it's done |
doneFor | 1600 | How long "Sent" stays before it splits back, in ms |
theme | 'light' | 'light' (ink blocks) or 'dark' (white blocks) |
width | 380 | Width in px |
height | 120 | Height in px. The words grow with it |
bot | 'hexagon' | The Bot's body: any of its nine shapes |
Accessibility
It's a single <button> with your label, so Tab, Enter and Space work and screen readers read one clear name. When it's done, it announces doneLabel. With reduced motion on, nothing springs or shakes: the blocks change size and run together straight away.
Colours from StackD
White #FFFFFF · Ink #141310 · Wine #901919 · Olive #6C8544 · Ochre #BE9344 · Lilac #C9B8FF
Licence
You can use it in personal and commercial projects. Don't resell or share the component on its own.
Made by StackD · stackd.codes
