Skip to content

Browse components

← All components

Citations

Inline citation markers and a collapsible source list.

Install
npx shadcn@latest add https://ui.anuragroy.dev/r/citations.json

Preview

Loading preview…

Installation

Add the component from this site. The shadcn CLI fetches the registry JSON over HTTPS — no named registry submission required.

Terminal
npx shadcn@latest add https://ui.anuragroy.dev/r/citations.json

GitHub fallback if the website is down:

Terminal
npx shadcn@latest add https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/citations.json

Usage

Import paths follow your components.json aliases. After install, the default path is @/components/ui/citations.

Import
import {  Citation,  CitationIndex,  CitationItem,  CitationLink,  CitationList,  CitationTitle,  CitationUrl} from "@/components/ui/citations"
example.tsx
import {  Citation,  CitationIndex,  CitationItem,  CitationLink,  CitationList,  CitationTitle,  CitationUrl,} from "@/components/ui/citations"export function Example() {  return (    <>      <p>        Keep the previous turn visible        <Citation href="#src-1" index={1} />.      </p>      <CitationList>        <CitationItem>          <CitationLink href="#src-1">            <CitationIndex>1</CitationIndex>            <CitationTitle>Turn anchoring</CitationTitle>            <CitationUrl>example.com</CitationUrl>          </CitationLink>        </CitationItem>      </CitationList>    </>  )}

API Reference

Citation

PropTypeDefault
hrefstring—
indexnumber—