Cameron Kelliher

AI Sources

AI chats 7

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

    126
  • Helix Loader

    Helix Loader

    106
  • AI Streaming Text

    AI Streaming Text

    58
  • AI Tool Call

    AI Tool Call

    50
  • Glitch Text Loader

    Glitch Text Loader

    48
  • Signal Bars Loader

    Signal Bars Loader

    47
  • AI Prompt Diff

    AI Prompt Diff

    46
  • Upstash Leaderboard

    Upstash Leaderboard

    45

More in AI chats

View all
  • AI Actions

    AI Actions

    361
  • Aquarium Prompt

    Aquarium Prompt

    158
  • Color Picker

    Color Picker

    224
  • AI Task List

    AI Task List

    198
  • Interactive LLM Token & Context Window Visualizer

    Interactive LLM Token & Context Window Visualizer

    2
  • AI Orb

    AI Orb

    211
  • Message

    Message

    53
  • Commit

    Commit

    43