Actions

The Action component provides a flexible row of action buttons for AI responses with common actions like retry, like, dislike, copy, and share.

Hello, how are you?

I am fine, thank you!

Installation

pnpm dlx shadcn-svelte@latest add https://svelte-ai-elements.vercel.app/r/action.json

Examples

Message Action

This is a response from an assistant. Try hovering over this message to see the actions appear!

Props

Actions

NameTypeDefault
children
Snippet
class
string ''
...restProps
HTMLAttributes<HTMLDivElement>

Action

NameTypeDefault
tooltip
string
label
string
children
Snippet
class
string
variant
'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link' 'ghost'
size
'default' | 'sm' | 'lg' | 'icon' 'sm'
onclick
(event: MouseEvent) => void
disabled
boolean
...restProps
HTMLButtonAttributes | HTMLAnchorAttributes