Skip to main content
Version: Next

AIResponseActions

The AIResponseActions toolbar is designed for placement at the bottom of messages in AI interfaces. It provides pre-styled actions for feedback (Thumbs Up / Down), regeneration, copying response contents, sharing, and bookmarking. It integrates seamlessly with <Tooltip> descriptions and utilizes spring physics for interactive feedback.

AI
Code Assistant
Here is a custom React hook that synchronizes component state with your router: ```typescript import { useEffect, useState } from 'react'; import { useRouter } from 'next/router'; export function useUrlState<T>(key: string, initialValue: T) { const router = useRouter(); // State synchronization logic... } ```
Helpful?

Installation

ignix add component ai-response-actions

Usage

import { AIResponseActions } from '@mindfiredigital/ignix-ui';```

### Basic Example

Choose which callbacks to enable. Action buttons are dynamically rendered based on the presence of callback properties:

```tsx

function MinimalActions() {
return (
<AIResponseActions
content="Response text to copy"
// Only copy (default) and feedback will render
onFeedback={(type) => console.log('Feedback submitted:', type)}
/>
);
}

Variants

Customize the surrounding container border styles with the variant property:

{/* Glassmorphic border variant for visual gradients */}
<AIResponseActions
content="Content text"
variant="glass"
onFeedback={(type) => {}}
/>

{/* Dark variant for darker layout wrappers */}
<AIResponseActions
content="Content text"
variant="dark"
onFeedback={(type) => {}}
/>

Props

PorpTypeDefaultDescription
contentstring-(Required) The textual response content to copy or share.
variant'default' | 'dark' | 'glass' | 'minimal''default'Surrounding toolbar card variants.
size'sm' | 'md''sm'Size adjustment parameter for action buttons.
onFeedback(type: 'up' | 'down') => void-Callback when thumbs up/down is toggled.
onRegenerate() => void-Callback when regenerate action is clicked.
onShare() => void-Callback when share action is clicked.
onBookmark() => void-Callback when bookmark saving is clicked.
feedback'up' | 'down' | null-Controlled state parameter for feedback buttons.
isBookmarkedboolean-Controlled state parameter for bookmark active fills.