Message Actions

Assistant message action row (`MessageActions`) with copy that morphs into a drawn check, regenerate that spins (continuously while its promise runs), exclusive thumbs up/down that pop in filled, a thumbs-down reason popover with toggle chips and comment, share and a more menu; reveals on message hover or focus and stays visible on touch or with `visibility="always"` for the last message — a standalone, richer counterpart to StreamingResponse's built-in actions.

Preview

Message Actions preview width

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @karaui/message-actions
@karaui not found? Add it to components.json
{
  "registries": {
    "@karaui": "https://karaui.kamisama-v0.my.id/r/{name}.json"
  }
}

@karaui is in shadcn's public registry directory, so the latest CLI needs no setup. On an older CLI, merge this into the existing file once and every @karaui/… install resolves.

API Reference

copyText?
string

Plain text copied by the copy action.

—
onCopy?
(() => void | Promise<void>)

Overrides the built-in clipboard write.

—
onRegenerate?
(() => void | Promise<void>)

Shows the regenerate action. A returned promise keeps the icon spinning.

—
feedback?
MessageFeedback
—
defaultFeedback?
MessageFeedback
null
onFeedbackChange?
((feedback: MessageFeedback) => void)
—
feedbackReasons?
MessageFeedbackReason[]

Reasons offered after a thumbs-down. Pass `[]` to skip the popover.

[ { value: "incorrect", label: "Incorrect" }, { value: "unhelpful", label: "Not helpful" }, { value: "incomplete", label: "Incomplete" }, { value: "instructions", label: "Ignored instructions" }, { value: "unsafe", label: "Harmful" }, ]
onFeedbackSubmit?
((details: MessageFeedbackDetails) => void)
—
onShare?
(() => void)
—
moreActions?
MessageMoreAction[]
[]
onMoreAction?
((value: string) => void)
—
visibility?
"hover" | "always"

`hover` reveals the row while the surrounding `Message` / message group is hovered or focused (always visible on touch); `always` keeps it shown — use it for the last message.

hover
className?
string
—

Updated