Skip to content
Design System
GitHub

Message actions

v0.64.0, changelogBeta

The actions under a model's answer (Copy, Regenerate, Good and Bad with a reason, a ‹ 2 / 3 › switcher), quiet until hovered or focused, always shown on touch and to the keyboard.

AssistantFleet assistant
Done in 2.4 s

Two can. Patrol dog 1715 is free after its car park round at 23:40 and ends the night at 31 % battery.

Large 2.4 s 1,204 tokens

Under an answer

Install
npx shadcn add @syncrobotic/message-actions

Also installs: lucide-react@^1, @syncrobotic/cn, @syncrobotic/button, @syncrobotic/chip-group, @syncrobotic/copy-button, @syncrobotic/format-number

Overview

When to use

  • Every assistant answer in a conversation.
  • An answer whose quality feeds an evaluation: Good and Bad with reasons.
  • An answer people regenerate until it suits them: the ‹ 2 / 3 › switcher.

Use something else

More examples

States and real uses. Each example is also a Storybook story and a visual regression test.

Bad with reason

Versions

Copy only

Traditional Chinese (zh-TW)

Usage rules

  • It goes in Message's actions. Each part shows only when you give what it needs: copyText for Copy, onRegenerate for Regenerate, onFeedbackChange for Good and Bad, versions above 1 for the switcher.
  • Good and Bad are toggles (aria-pressed), inverted when pressed like every selected control, never green or red. Pressing the pressed one again clears it.
  • Give reasons to ask what was wrong after Bad: a few short ones ("Wrong facts", "Did not follow the request"). Send the feedback and the reason from onFeedbackChange and onReasonChange.
  • Regenerating adds a version: pass version and versions and switch the shown answer in onVersionChange. The switcher's ends stay focusable and say they are the end.
  • quiet (on by default) keeps the buttons out of sight until the turn is hovered or focused, with a mouse only: touch screens and keyboards always see them. Set it false on the latest answer. Feedback that was given and the switcher never hide.
  • Every button is an icon with its name in aria-label; 36 px with a mouse, 44 on touch.

Changelog

  • 0.64.02026-12-01Formatted with Prettier (class order sorted); the code is unchanged.
  • 0.53.02026-11-27Its doc opens with its description, word for word; the code is unchanged.
  • 0.51.02026-11-27Comments trimmed to what they need to say; the code is unchanged.

How to upgrade