Shehryar Ali

Recommendation Card

AI chats

About

Agent suggestion card with inline entity and value chips, a confidence meter, an alternatives drawer and accept action.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Recommendation Card to your project and fits it to your theme.

Code

How Recommendation Card is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import RecommendationCard, { EntityChip, ValuePill, type RecommendationOption } from "@/components/ui/recommendation-card";

/* all content lives here; the component only renders what it is given */

const OPTIONS: RecommendationOption[] = [
  {
    key: "scale",
    body: (
      <>
        Add two nodes to <EntityChip name="api-prod-east" color="#6366f1" /> before traffic peaks in{" "}
        <ValuePill tone="success">40 min</ValuePill>
      </>
    ),
    short: "Scale api-prod-east by 2 nodes",
    signal: 3,
    tone: "success",
    label: "High confidence",
    cta: "Scale now",
    ctaVariant: "accent",
  },
  {
    key: "cache",
    body: (
      <>
        Raise the edge cache TTL to <ValuePill>10 minutes</ValuePill> for read-heavy endpoints.
      </>
    ),
    short: "Raise edge cache TTL to 10 min",
    signal: 2,
    tone: "warning",
    label: "Needs review",
    cta: "Configure",
  },
  {
    key: "none",
    body: (
      <>
        Keep the current capacity and <span className="font-medium text-foreground">alert on-call</span> if p95 latency crosses 400 ms.
      </>
    ),
    short: "Keep capacity, alert on-call",
    signal: 0,
    tone: "neutral",
    label: "No signal",
    cta: "Set alert",
  },
];

export default function RecommendationCardDemo() {
  return (
    <div className="flex min-h-[520px] w-full items-center justify-center bg-background p-8">
      <RecommendationCard
        title="Want me to scale the cluster ahead of the spike?"
        options={OPTIONS}
        onAccept={(option) => console.log("accept:", option.key)}
      />
    </div>
  );
}

More by Shehryar Ali

View all
  • Loading State

    Loading State

    19
  • Insight Cards

    Insight Cards

    9
  • Streaming Text

    Streaming Text

    9
  • Murmur Ember Silk

    Murmur Ember Silk

    3
  • Murmur Ember Tide

    Murmur Ember Tide

    1
  • Granite Sky Aurora

    Granite Sky Aurora

    1
  • Prompt Bar

    Prompt Bar

    1
  • Records Table

    Records Table

More in AI chats

View all
  • Agent Chat

    Agent Chat

    21
  • AI Actions

    AI Actions

    372
  • AI Suggestions

    AI Suggestions

    27
  • Interactive LLM Token & Context Window Visualizer

    Interactive LLM Token & Context Window Visualizer

    30
  • AI SaaS Workflow Hero

    AI SaaS Workflow Hero

    36
  • Aquarium Prompt

    Aquarium Prompt

    219
  • Message Parts

    Message Parts

    10
  • AI Chat Composer

    AI Chat Composer

    21