Sources
A collapsible citations drawer displaying a source counter trigger, spring height reveal, and staggered blur-fade reference links.
Customize
Installation
npx shadcn@latest add @kinetic/sourcesUsage
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.
| Prop | Type | Default | Description |
|---|---|---|---|
open / defaultOpen / onOpenChange | boolean / boolean / (open: boolean) => void | false | Controlled or initial expanded state. |
speed / blurPx / staggerMs | number / number / number | 0.45 / 8 / 95 | Speed multiplier, blur radius (px), and delay between consecutive Source links (ms). |
keepMounted / disabled | boolean / boolean | false / false | Keeps source links mounted while closed or disables toggling. |
SourcesTrigger / SourcesContent / Source
Overshoot-rotated trigger, height-morphed staggered container, and external source link.
| Prop | Type | Default | Description |
|---|---|---|---|
count (SourcesTrigger) | number | 0 | Displayed source count in the default trigger label. |
keepMounted / forceMount / speed / blurPx / staggerMs (SourcesContent) | boolean / boolean / number / number / number | inherited | Local overrides for mounting behavior and stagger reveal timing. |
href / title (Source) | string / string | - | Source URL and readable title. |