Cameron Kelliher

AI Sources

AI chats 4

About

A collapsible citations panel that lists AI response sources with favicons, titles, hostnames, and snippets, used for RAG or search-result attribution.

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

Code

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

Usage.tsx

"use client";

import {
  AiSources,
  AiSourcesTrigger,
  AiSourcesContent,
} from "@/components/ui/sources";

const sources = [
  {
    url: "https://react.dev/learn",
    title: "React Documentation",
    snippet: "Learn React with interactive tutorials and guides.",
  },
  {
    url: "https://nextjs.org/docs",
    title: "Next.js Documentation",
  },
];

export default function SourcesDemo() {
  return (
    <div className="w-full max-w-md">
      <AiSources sources={sources}>
        <AiSourcesTrigger>Referenced Sources</AiSourcesTrigger>
        <AiSourcesContent />
      </AiSources>
    </div>
  );
}

Dependencies

More by Cameron Kelliher

View all
  • AI Chain of Thought

    AI Chain of Thought

    111
  • Helix Loader

    Helix Loader

    94
  • AI Streaming Text

    AI Streaming Text

    50
  • AI Tool Call

    AI Tool Call

    45
  • Signal Bars Loader

    Signal Bars Loader

    41
  • Glitch Text Loader

    Glitch Text Loader

    41
  • AI Prompt Diff

    AI Prompt Diff

    39
  • AI Routing Indicator

    AI Routing Indicator

    34

More in AI chats

View all
  • AI Actions

    AI Actions

    319
  • Color Picker

    Color Picker

    81
  • Agent Chat

    Agent Chat

    17
  • Prompt with Model Picker

    Prompt with Model Picker

    2
  • Message Thread

    Message Thread

    35
  • System Message

    System Message

    54
  • Suggestions

    Suggestions

    28
  • Message With Header And Delivery Status

    Message With Header And Delivery Status

    38