Skip to main content

Sources

A collapsible citations drawer displaying a source counter trigger, spring height reveal, and staggered blur-fade reference links.

@heroicons/react

Customize

Speed0.45
Blur reveal (px)8
Stagger (ms)95

Installation

npx shadcn@latest add @kinetic/sources

Usage

Combine Sources, SourcesTrigger, SourcesContent, and Source to list links consulted during a response.

import {
  Source,
  Sources,
  SourcesContent,
  SourcesTrigger,
} from "@/components/kinetic/ui/sources";

export function ConsultedSources() {
  return (
    <Sources defaultOpen>
      <SourcesTrigger count={2} />
      <SourcesContent>
        <Source href="https://react.dev/reference" title="React 19 Reference" />
        <Source href="https://nextjs.org/docs" title="Next.js Documentation" />
      </SourcesContent>
    </Sources>
  );
}

Controlled disclosure

Control expansion with open and onOpenChange, or customize the trigger text by passing children to SourcesTrigger. Setting keepMounted keeps links in the DOM while collapsed.

interface SourcesPanelProps {
  readonly open: boolean;
  readonly onOpenChange: (open: boolean) => void;
}

export function ControlledSources({ open, onOpenChange }: SourcesPanelProps) {
  return (
    <Sources open={open} onOpenChange={onOpenChange} keepMounted>
      <SourcesTrigger>Inspect 2 references</SourcesTrigger>
      <SourcesContent>
        <Source href="https://tailwindcss.com/docs" title="Tailwind CSS v4" />
        <Source href="https://motion.dev/docs" title="Motion" />
      </SourcesContent>
    </Sources>
  );
}

Motion preferences

SourcesContent pairs useAnimatedSize height expansion with staggerReveal (staggerMs: 95, blurPx: 8, speed: 0.45). Reduced motion reveals links immediately without stagger or blur.

API Reference

Sources

Zero-dependency collapsible citations drawer with spring height reveal and staggered blur-fade link cascade.

PropTypeDefaultDescription
open / defaultOpen / onOpenChangeboolean / boolean / (open: boolean) => voidfalseControlled or initial expanded state.
speed / blurPx / staggerMsnumber / number / number0.45 / 8 / 95Speed multiplier, blur radius (px), and delay between consecutive Source links (ms).
keepMounted / disabledboolean / booleanfalse / falseKeeps source links mounted while closed or disables toggling.

SourcesTrigger / SourcesContent / Source

Overshoot-rotated trigger, height-morphed staggered container, and external source link.

PropTypeDefaultDescription
count (SourcesTrigger)number0Displayed source count in the default trigger label.
keepMounted / forceMount / speed / blurPx / staggerMs (SourcesContent)boolean / boolean / number / number / numberinheritedLocal overrides for mounting behavior and stagger reveal timing.
href / title (Source)string / string-Source URL and readable title.