AI Suggestion Panel

AI
Adaptive
Block

Proactive AI suggestions based on user context and behavior. Features three suggestion types (action, insight, shortcut) with confidence scores, dismissable cards, and a learning footer.

Preview

Default suggestions with all three types

AI Suggestions

Personalized for you

3 new

Complete your weekly review

94% match

Based on your routine, you usually do this on Fridays at 3pm

Productivity up 23% this week

88% match

You completed 12 tasks this week, compared to 9 last week

Quick action available

82% match

You frequently check the Marketing Strategy project at this time

AI learns from your actions to improve suggestions

Suggestion Types

Three color-coded types for different contexts

Action (Indigo)

AI Suggestions

Personalized for you

1 new

Complete weekly review

94% match

Based on your routine

Insight (Teal)

AI Suggestions

Personalized for you

1 new

Productivity up 23%

88% match

You completed more tasks

Shortcut (Amber)

AI Suggestions

Personalized for you

1 new

Quick action available

82% match

Frequently used project

Custom Suggestions

Provide your own suggestion data

AI Suggestions

Personalized for you

2 new

Schedule team meeting

92% match

Based on your calendar, Wednesday afternoon is optimal

Sprint velocity increased

87% match

Your team completed 15% more story points this sprint

AI learns from your actions to improve suggestions

Without Footer

Hide the learning footer for compact layouts

AI Suggestions

Personalized for you

3 new

Complete your weekly review

94% match

Based on your routine, you usually do this on Fridays at 3pm

Productivity up 23% this week

88% match

You completed 12 tasks this week, compared to 9 last week

Quick action available

82% match

You frequently check the Marketing Strategy project at this time

Props

AISuggestionPanel component API reference

PropTypeDefaultDescription
suggestionsSuggestion[](default suggestions)Array of suggestions to display
onAction(suggestion: Suggestion) => voidCallback when action button is clicked
onDismiss(suggestionId: string | number) => voidCallback when suggestion is dismissed
onPreferences() => voidCallback when preferences link is clicked
showFooterbooleantrueShow the learning footer with preferences link
classNamestringAdditional CSS classes for the container

Suggestion Type

PropTypeDefaultDescription
id*string | numberUnique suggestion identifier
type*'action' | 'insight' | 'shortcut'Suggestion type (determines color)
iconLucideIconCustom icon (uses type default if not provided)
title*stringSuggestion title
description*stringSuggestion description
confidence*numberConfidence score (0-100)
action*stringAction button label

SuggestionType

"action" |"insight" |"shortcut"

Usage

Import and implementation example

import { AISuggestionPanel } from '@/blocks/ai-conversation/ai-suggestion-panel'
import { Target, TrendingUp, Zap } from 'lucide-react'

export default function Example() {
  const suggestions = [
    {
      id: 1,
      type: 'action',
      icon: Target,
      title: 'Complete your weekly review',
      description: 'Based on your routine, you usually do this on Fridays',
      confidence: 94,
      action: 'Start Review',
    },
    {
      id: 2,
      type: 'insight',
      icon: TrendingUp,
      title: 'Productivity up 23%',
      description: 'You completed 12 tasks this week',
      confidence: 88,
      action: 'View Details',
    },
    {
      id: 3,
      type: 'shortcut',
      icon: Zap,
      title: 'Quick action available',
      description: 'You frequently check this project',
      confidence: 82,
      action: 'Open Project',
    },
  ]

  const handleAction = (suggestion) => {
    console.log('Action clicked:', suggestion)
  }

  const handleDismiss = (id) => {
    console.log('Dismissed:', id)
  }

  return (
    <AISuggestionPanel
      suggestions={suggestions}
      onAction={handleAction}
      onDismiss={handleDismiss}
      onPreferences={() => navigate('/settings/ai')}
    />
  )
}

Built With

1 component

This block uses the following UI components from the design system:

Features

Built-in functionality

  • Three suggestion types: Action (indigo), Insight (teal), and Shortcut (amber)
  • Confidence scores: Display match percentage badge for each suggestion
  • Contextual actions: Custom action button label per suggestion
  • Dismissable cards: Users can dismiss individual suggestions
  • Color-coded icons: Type-specific background colors with matching icons
  • Learning footer: Optional footer with AI learning message and preferences
  • Dynamic counter: Header badge shows count of visible suggestions
  • Hover effects: Smooth background transitions on hover
  • Gradient header: Indigo-to-teal gradient on wand icon
  • Dark mode: Full dark mode support

Accessibility

Accessibility considerations

ARIA Attributes

Action and dismiss buttons are native button elementsPreferences link is a native button elementSuggestions use semantic div structure

Keyboard Navigation

KeyAction
TabNavigate between action and dismiss buttons
Enter / SpaceActivate the focused button

Notes

  • Confidence badges provide context about suggestion relevance
  • Icon colors match type for visual consistency
  • Dismissed suggestions are removed from DOM
  • Consider adding role="list" for suggestion container
  • Consider adding aria-live region for dynamic counter updates