Skip to content

MessageActions

Stable

Copy and retry buttons that sit under an assistant reply.

Also known as message toolbar, copy retry, response actions, actions

Install with npm install @tattva/ui (setup), or copy the code from the kit in Downloads.

Copy only

Without the retry option, only Copy shows.

When to use it

Small icon buttons under a reply for what people do after reading it: copy it, or ask for a new one. Icons keep the row quiet so it does not compete with the answer.

Made of: Copy button · Regenerate button

Use it for

  • Under every finished assistant reply.
  • Offering a fresh answer: pass onRegenerate to show the second button.

Not for

Do and avoid

Assistant: Your flight lands at 9:40. The hotel lets you check in from 2 pm.
Do. Quiet icons under the reply let people copy it or ask again.
When does my flight land?
Avoid. Actions on your own message make no sense and add clutter.

Do

  • Put it at the bottom of an assistant Message once the reply is finished.
  • Give it the plain text of the answer.
  • Add Regenerate only when a new try is possible.

Avoid

  • Do not show it on a person's messages or while the reply is still appearing.
  • Do not add more than a few actions. Put extras in a menu.
  • Do not assume copying always works. If the browser blocks it, nothing is shown.

On a phone

  • The copy and regenerate buttons stay 28px square on touch screens and have a 44px tap area.
  • The buttons have a title for hover, which a phone does not show, so the label is read by screen readers only.
  • Copy needs clipboard access from the browser. If it is blocked, nothing happens and no error is shown.

Build your next AI screen with Tattva.

Free and open, with the code. Start in one line.

Get started