About
Citations display inline references to external sources. Use them to attribute information within AI-generated responses, articles, or anywhere provenance and source links are needed.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Astryx Citation to your project and fits it to your theme.
Code
How Astryx Citation is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
'use client';
import {Citation} from '@/components/ui/astryx-citation';
import {Text} from '@astryxdesign/core/Text';
import {Stack} from '@astryxdesign/core/Layout';
function CitationInlineText() {
return (
<Stack direction="vertical" gap={4} style={{maxWidth: 560}}>
<Text type="body">
React uses a virtual DOM to minimize expensive DOM operations
<Citation
source={{title: 'React Documentation', url: 'https://react.dev'}}
number={1}
variant="number"
/>
. This approach was inspired by earlier functional UI frameworks
<Citation
source={{
title: 'Elm Architecture',
url: 'https://guide.elm-lang.org/architecture/',
}}
number={2}
variant="number"
/>
.
</Text>
<Text type="body">
TypeScript adds static types to JavaScript for safer refactoring
<Citation
source={{
title: 'TypeScript Documentation',
url: 'https://www.typescriptlang.org',
icon: 'https://cdn.21st.dev/assets/mirror/a5/a5b6010ffce7ff3b2e601dd2c4f87e3bde8c563b42c8f99a6e0892aa1d8313d9.png',
}}
number={3}
variant="label"
/>
.
</Text>
</Stack>
);
}
export default function CitationInlineTextDemo() {
return (
<div
data-astryx-theme="neutral"
data-theme="light"
style={{colorScheme: 'light', display: 'contents'}}>
<CitationInlineText />
</div>
);
}






