MessageActions

Copy, thumbs up, thumbs down, regenerate. The copy icon turns to a check, thumbs fill and pop, regenerate spins. AI.

Open playground

About

MessageActions is a React component in the AI category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { MessageActions } from "@ashutoshswamy/smoui" and set text, onFeedback, onRegenerate.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { MessageActions } from "@ashutoshswamy/smoui";

<MessageActions text={reply} onFeedback={(v) => rate(v)} onRegenerate={() => retry()} />

Props 3

text

Text copied by the copy button.

string
onFeedback

Called on vote; picking one clears the other.

(value: "up" | "down" | null) => void
onRegenerate

Called on regenerate.

() => void