Astryx

Astryx Citation

Component

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>
  );
}

Dependencies

More by Astryx

View all
  • Astryx Banner

    Astryx Banner

    59
  • Astryx Aspect Ratio

    Astryx Aspect Ratio

    31
  • Astryx Avatar

    Astryx Avatar

    30
  • Astryx Badge

    Astryx Badge

    29
  • Astryx Button Group

    Astryx Button Group

    27
  • Astryx Chat Composer Drawer

    Astryx Chat Composer Drawer

    20
  • Astryx Toggle Button

    Astryx Toggle Button

    17
  • Astryx Avatar Group

    Astryx Avatar Group

    9