Launch priceOne payment

Message Actions

Copy turns into a tick, the regenerate arrow keeps turning while the new answer is on its way, and a thumbs down asks why with one tap per reason. After a regenerate, a pager moves between the answers to the same question.

AI ChatFree290 lines · one file

Ready for AI tools one file typed props installs by name prompt included

Installation

How you get it

Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.

Use Layro's Message Actions for this.
Install it: npx shadcn@latest add https://layropro.com/r/message-actions
Import it from @/components/ui/message-actions.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.

For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above.

API

“Copy prompt” above puts a full brief on your clipboard — install command, dependencies, props, and the mistakes an assistant usually makes with this component.

Props

Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.

PropTypeNotes
textstringWhat Copy puts on the clipboard. Leave it out to hide Copy.
onCopy(text: string) => voidCalled after the text is copied.
onRegenerate() => voidLeave it out to hide Regenerate.
regeneratingbooleanKeeps the arrow turning and the button busy.
feedbackMessageFeedback—
defaultFeedbackMessageFeedback—
onFeedbackChange(value: MessageFeedback) => voidLeave it out, with no `feedback`, to hide the thumbs.
reasonsstring[]Asked after a thumbs down. Pass an empty array to skip the question.
onReason(reason: string) => void—
versionMessageVersionAdds the pager between regenerated answers.
childrenReact.ReactNodeExtra buttons, placed after the built-in ones.

Dependencies

npm packages

clsxframer-motionlucide-reacttailwind-merge

Layro foundations, installed alongside it

layro-themebuttontooltip

Lifetime access

Every component, and everything we ship next.

  • All 112 components, source included
  • The template, and everything released after you buy
  • shadcn CLI or download — React 18/19, Tailwind v4
  • One payment. No subscription.

More in AI Chat

All AI Chat components