Inline Citation

The Inline Citation component provides a way to display citations inline with text content, similar to academic papers or research documents. It consists of a citation pill that shows detailed source information on hover, making it perfect for AI-generated content that needs to reference sources.

Inline Citation Example

Modern web development has evolved significantly over the past few years. New frameworks like Svelte offer better performance and developer experience compared to traditional approaches.

Installation

pnpm dlx shadcn-svelte@latest add https://svelte-ai-elements.vercel.app/r/inline-citation.json

If you prefer using jsrepo, please install via the command below:

pnpm dlx jsrepo add @ai/elements/ai-elements/inline-citation

Props

InlineCitation

NameTypeDefault
class
string
children
Snippet
...restProps
HTMLAttributes<HTMLSpanElement>

InlineCitationCard

NameTypeDefault
closeDelay
number 0
openDelay
number 0
open
boolean
children
Snippet

InlineCitationCardTrigger

NameTypeDefault
sources
string[]
variant
'default' | 'secondary' | 'destructive' | 'outline' 'secondary'
class
string
children
Snippet

InlineCitationCardBody

NameTypeDefault
class
string
children
Snippet

InlineCitationCarousel

NameTypeDefault
class
string
opts
object
plugins
any[]
orientation
'horizontal' | 'vertical' 'horizontal'
children
Snippet

InlineCitationCarouselHeader

NameTypeDefault
class
string
children
Snippet
...restProps
HTMLAttributes<HTMLDivElement>

InlineCitationCarouselContent

NameTypeDefault
class
string
children
Snippet

InlineCitationCarouselItem

NameTypeDefault
class
string
children
Snippet

InlineCitationCarouselNext

NameTypeDefault
class
string
...restProps
HTMLButtonAttributes

InlineCitationCarouselPrev

NameTypeDefault
class
string
...restProps
HTMLButtonAttributes