EXEPERTAI LAB

Research alpha

Time Machine
EXEPERTAI LAB
GALLERY / COLLECTION
← Browse Astryx gallery
Citation·component·@astryxdesign/core

Citation

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.

Open in Playground @astryxdesign/core/Citation

Showcases and examples

3 documented examples

Citation — Showcase

All citation variants at a glance: label chips and numbered badges, with and without icons and links.

Preview loads on approachPreview loads on approach
Exact source · citation-showcase
// Copyright (c) Meta Platforms, Inc. and affiliates.

'use client';

import {Citation} from '@astryxdesign/core/Citation';
import {Stack} from '@astryxdesign/core/Layout';
import {Text} from '@astryxdesign/core/Text';

export default function CitationShowcase() {
  return (
    <Stack direction="vertical" gap={6}>
      <Stack direction="vertical" gap={2}>
        <Text type="supporting" color="secondary">
          Label variant
        </Text>
        <Stack direction="horizontal" gap={2} style={{flexWrap: 'wrap'}}>
          <Citation
            source={{title: 'React Documentation', url: 'https://react.dev'}}
            number={1}
            variant="label"
          />
          <Citation
            source={{
              title: 'GitHub',
              url: 'https://github.com',
              icon: 'https://github.githubassets.com/favicons/favicon.svg',
            }}
            number={2}
            variant="label"
          />
          <Citation
            source={{title: 'Internal reference'}}
            number={3}
            variant="label"
          />
        </Stack>
      </Stack>
      <Stack direction="vertical" gap={2}>
        <Text type="supporting" color="secondary">
          Number variant
        </Text>
        <Stack direction="horizontal" gap={2}>
          <Citation
            source={{
              title: 'TypeScript Handbook',
              url: 'https://typescriptlang.org',
            }}
            number={1}
            variant="number"
          />
          <Citation
            source={{
              title: 'MDN Web Docs',
              url: 'https://developer.mozilla.org',
            }}
            number={2}
            variant="number"
          />
          <Citation
            source={{title: 'W3C Specification'}}
            number={3}
            variant="number"
          />
        </Stack>
      </Stack>
    </Stack>
  );
}

Usage

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.

  • Use the label variant when the source title adds meaningful context for the reader.
  • Use the number variant for compact inline references within body text, like footnotes.
  • Mix label and number variants in the same paragraph. Pick one style per context for visual consistency.

Typed props

PropType and behavior
sourceCitationSource · required
The citation source object containing title, url, an optional image src, and an optional icon node. The url follows the shared navigation rule described on the Link href prop; rejected destinations leave the citation visible without navigation. Image src uses separate resource handling.
numbernumber · required
The display index for this citation.
variant'label' | 'number' · default 'label'
Display style: a label chip showing the source title or a compact numbered badge.

Anatomy

Container · required

The interactive wrapper. Renders as an anchor when a URL is provided, or a span otherwise.

Icon · optional

An optional source icon shown before the label text. Accepts a favicon/logo image URL (via source.src) or a React node such as an Astryx <Icon>. Only available in the label variant.

Label text · optional

The source title, truncated with ellipsis when it exceeds the max width. Shown in the label variant.

Number · optional

The citation index displayed as a superscript badge. Shown in the number variant.

Theming

Targets

astryx-citation

Visual props: variant