Skip to content
Calm motion: animations on this site only fade, with no movement

Message feedback ​

Good, bad, copy, and retry buttons under a reply

Lets the reader mark a reply of an assistant as good or bad, copy it, or ask for a new one. After a bad mark, a small form asks what was wrong. For suggested next questions, use the suggestions.

Basic

Try “Home Studio, Real Sound”. It is short, it names the topic, and it is easy to say out loud.

Sent: nothing yet · Tries: 1

  • v-model:rating is good, bad, or none. A click on the pressed mark clears it. A pressed mark is filled, so the state is more than a color.
  • A good mark emits feedback with { rating: "good" } at once.
  • A bad mark opens a form. The reader can pick one of the reasons and type a note. "Send" emits feedback with { rating: "bad", reason, note }.
  • copy is the text of the reply. With it, a copy button shows. retry shows a button that emits retry.
  • The buttons have only icons, so each one has a name for screen readers and a tooltip. A hidden status line says "Thanks for the feedback" and "Copied".
  • Change the words with labels or a label pack: good, bad, copy, copied, retry, ask, note, send, cancel, and thanks. The reasons are your own words, so translate them yourself.

Usage ​

ts
import { BlessMessageFeedback } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
copystring—the text of the reply; with it, a copy button shows
retryboolean—show a button that asks for a new reply
reasonsstring[]—reasons to pick from after a bad mark, for example `["Not true", "Too long"]`
labelsPartial<{ good: string; bad: string; copy: string; copied: string; retry: string; ask: string; note: string; send: string; cancel: string; thanks: string; }>—
rating"bad" | "good"—the mark of the reader: `good`, `bad`, or none

Events

NamePayloadDescription
feedback[event: BlessMessageFeedbackEvent]
update:rating[value: "bad" | "good" | undefined]
retry[]

Released under the MIT License. Character names and artwork belong to their owners.