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
vue
<template>
<div style="max-width: 560px">
<p style="margin-top: 0">{{ reply }}</p>
<BlessMessageFeedback
v-model:rating="rating"
:copy="reply"
retry
:reasons="['Not true', 'Not helpful', 'Too long', 'Other']"
@feedback="log"
@retry="tries++"
/>
<BlessText as="p" size="sm" style="margin-top: 12px">
Sent: {{ last }} · Tries: {{ tries }}
</BlessText>
</div>
</template>
<script setup lang="ts">
import { ref } from "vue";
import { BlessMessageFeedback, BlessText, type BlessMessageFeedbackEvent } from "blessing-ui";
const reply =
"Try “Home Studio, Real Sound”. It is short, it names the topic, and it is easy to say out loud.";
const rating = ref<"good" | "bad">();
const last = ref("nothing yet");
const tries = ref(1);
const log = (e: BlessMessageFeedbackEvent) => (last.value = JSON.stringify(e));
</script>v-model:ratingisgood,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
feedbackwith{ rating: "good" }at once. - A bad mark opens a form. The reader can pick one of the
reasonsand type a note. "Send" emitsfeedbackwith{ rating: "bad", reason, note }. copyis the text of the reply. With it, a copy button shows.retryshows a button that emitsretry.- 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
labelsor a label pack:good,bad,copy,copied,retry,ask,note,send,cancel, andthanks. Thereasonsare your own words, so translate them yourself.
Usage
ts
import { BlessMessageFeedback } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
copy | string | — | the text of the reply; with it, a copy button shows |
retry | boolean | — | show a button that asks for a new reply |
reasons | string[] | — | reasons to pick from after a bad mark, for example `["Not true", "Too long"]` |
labels | Partial<{ 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
| Name | Payload | Description |
|---|---|---|
feedback | [event: BlessMessageFeedbackEvent] | |
update:rating | [value: "bad" | "good" | undefined] | |
retry | [] |