Cameron Kelliher

AI Sources

AI chats 5

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

    122
  • Helix Loader

    Helix Loader

    104
  • AI Streaming Text

    AI Streaming Text

    55
  • AI Tool Call

    AI Tool Call

    49
  • Glitch Text Loader

    Glitch Text Loader

    46
  • Signal Bars Loader

    Signal Bars Loader

    45
  • AI Prompt Diff

    AI Prompt Diff

    45
  • Upstash Leaderboard

    Upstash Leaderboard

    40

More in AI chats

View all
  • AI Actions

    AI Actions

    352
  • Aquarium Prompt

    Aquarium Prompt

    115
  • Research Report

    Research Report

    7
  • Agent Chat

    Agent Chat

    21
  • Message With Header And Delivery Status

    Message With Header And Delivery Status

    62
  • Tool Web Fetch

    Tool Web Fetch

    4
  • Color Picker

    Color Picker

    204
  • Suggestions

    Suggestions

    40