Edu Calvo

AI Citation

AI chats 27

About

Inline citation pill that opens an origin-aware source card anchored to the pill you clicked, instead of a floating popover. Respects prefers-reduced-motion.

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

Code

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

Usage.tsx

"use client";

import Component from "@/components/ui/ai-citation";

export default function DemoOne() {
  return (
    <div className="flex min-h-[440px] w-full items-center justify-center bg-background p-10">
      <div className="w-full max-w-lg rounded-2xl border bg-card p-6 shadow-sm">
        <p className="font-semibold text-foreground text-sm">Answer</p>
        <p className="mt-3 text-foreground text-sm leading-relaxed">
          Spring animations are preferred over fixed-duration tweens for
          interface motion because they stay interruptible
          <Component
            description="Springs keep momentum when a new target arrives mid-flight, so an interrupted animation never snaps."
            label={1}
            title="Spring options"
            url="https://motion.dev/docs/react-transitions"
          />{" "}
          and because the browser can run transform and opacity off the main
          thread
          <Component
            description="Only transform and opacity are composited. Animating width or top forces layout on every frame."
            label={2}
            title="Animations guide"
            url="https://web.dev/animations-guide"
          />
          . Keep the bounce at or below 0.1 for UI
          <Component
            description="Higher bounce reads as playful. A dialog that wobbles open looks broken rather than lively."
            label={3}
            title="Animation best practices"
            url="https://smoothui.dev/docs/guides/animation-best-practices"
          />
          .
        </p>
        <p className="mt-5 border-t pt-4 text-muted-foreground text-xs">
          Click a citation to open its source card.
        </p>
      </div>
    </div>
  );
}

Dependencies

More by Edu Calvo

View all
  • Scrollable Card Stack

    Scrollable Card Stack

    235
  • AI Task List

    AI Task List

    160
  • Siri Orb

    Siri Orb

    160
  • Cursor Follow

    Cursor Follow

    154
  • Pixel Flow Field

    Pixel Flow Field

    142
  • Agent Avatar

    Agent Avatar

    130
  • Gravity Stars

    Gravity Stars

    112
  • Coverflow Carousel

    Coverflow Carousel

    95

More in AI chats

View all
  • AI Actions

    AI Actions

    319
  • Agent Chat

    Agent Chat

    17
  • System Message

    System Message

    54
  • Message Thread

    Message Thread

    35
  • Color Picker

    Color Picker

    81
  • Modal Card

    Modal Card

    101
  • Quota Banner

    Quota Banner

    21
  • Approval Card

    Approval Card

    14