DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to add a polished message action bar to an AI chat with Affectui

Drop a finished copy, regenerate, feedback and read-aloud bar under each AI reply in one file.

Short answer: Run npx shadcn@latest add https://www.affectui.com/r/message-actions.json in the project root; then open the generated file in components/ui and read the props on the item page at https://www.affectui.com/components/message-actions; import the component into the chat message renderer with import { MessageActions } from "@/components/ui/message-actions";. All steps.

Who it is forA frontend developer building an AI chat interface who needs the controls under each assistant message to feel finished.

The problemBuilding copy, regenerate, thumbs and read-aloud controls with clear state changes takes time and is easy to get visually or accessibly wrong.

The outcomeA working Message Actions component in components/ui that shows copy confirmation, regenerate feedback and feedback buttons under AI replies.

What you need first

  • A React 19 project, with or without TypeScript
  • A setup that supports the shadcn CLI, such as Next.js or shadcn-configured projects with the @/* import alias
  • Access to the affectui.com registry URLs

Steps

  1. Run npx shadcn@latest add https://www.affectui.com/r/message-actions.json in the project root.
  2. Open the generated file in components/ui and read the props on the item page at https://www.affectui.com/components/message-actions.
  3. Import the component into the chat message renderer with import { MessageActions } from "@/components/ui/message-actions";. (inferred, check the README)
  4. Connect your own copy, regenerate and feedback handlers to the component props.
  5. Send a test AI reply in the app and confirm the bar appears and the copy control shows a check after a click.

Prompt for your agent

In the affectui repo context, install the message-actions item into the <project-path> Next.js or React 19 project using `npx shadcn@latest add https://www.affectui.com/r/message-actions.json`, then render it under the last assistant message in <chat-component-file>. Expected output: a MessageActions import and usage in that file with your existing handlers wired to props. Verify the project still builds and the bar renders with no console errors.

Caveat. The README describes the component behavior but the exact props for your handlers are on the item page, so check them there before wiring the bar to your API.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for flohoeller/affectui and "Add a polished message action bar to an AI chat"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer