# Angular LLM Kit Citation

In Retrieval-Augmented Generation (RAG)-powered applications for legal research, medical information, or financial analysis, users must be able to trace every AI claim back to a real source. Use the Citation component to connect each claim with the source that supports it.

The [Citation component](https://www.telerik.com/kendo-angular-ui-develop/components/conversational-ui/api/citationcomponent) embeds an inline reference chip directly inside AI-generated text. By default, hovering over the chip opens a popover with full source details for each cited resource, so readers get evidence without leaving the page.

The following example demonstrates the Citation component embedded in a text paragraph with multiple sources.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/conversational-ui/llm-kit/citation/source.txt)

## Adding Source References

When using the Citation component, place it next to the claim that it supports, so the connection between statement and evidence is clear at a glance. To populate the Citation popover with sources, provide an array of [`CitationSource`](https://www.telerik.com/kendo-angular-ui-develop/components/conversational-ui/api/citationsource) objects to the [`sources`](https://www.telerik.com/kendo-angular-ui-develop/components/conversational-ui/api/citationcomponent#sources) property of the component and specify [`title`](https://www.telerik.com/kendo-angular-ui-develop/components/conversational-ui/api/citationsource#title), [`url`](https://www.telerik.com/kendo-angular-ui-develop/components/conversational-ui/api/citationsource#url), and [`description`](https://www.telerik.com/kendo-angular-ui-develop/components/conversational-ui/api/citationsource#description) for each source.

```HTML
<p>
    The model outperformed all prior baselines on the evaluation benchmark
    <kendo-citation [sources]="sources"></kendo-citation>
    across five independent runs.
</p>
```

```TypeScript
public sources: CitationSource[] = [
    {
        title: 'Advances in Natural Language Processing',
        url: 'https://example.com/nlp-advances',
        description: 'A comprehensive study on recent NLP developments.'
    },
    {
        title: 'Retrieval-Augmented Generation: A Survey',
        url: 'https://arxiv.org/abs/2312.10997',
        description: 'Survey of RAG architectures and citation grounding mechanisms.'
    }
];
```

## Controlling the Popover Display

Use the [`showOn`](https://www.telerik.com/kendo-angular-ui-develop/components/conversational-ui/api/citationcomponent#showon) property of the Citation to control how users should interact with the Citation chip to open the source popover.

By default, the popover is opened when users hover over the Citation chip. Set `showOn` to `click` when users require an explicit action to open the source details, such as on touch devices.

```html
<p>
    The model outperformed all prior baselines on the evaluation benchmark
    <kendo-citation [sources]="sources" showOn="click"></kendo-citation>
    across five independent runs.
</p>
```

## Customizing the Citation

The Citation provides a [`kendoCitationBodyTemplate`](https://www.telerik.com/kendo-angular-ui-develop/components/conversational-ui/api/citationbodytemplatedirective) directive that can be used to replace the default source details in the popover. The template receives the current [`CitationSource`](https://www.telerik.com/kendo-angular-ui-develop/components/conversational-ui/api/citationsource) as the implicit `source` value, so you can control which source properties appear and how they are arranged.

```html
<kendo-citation [sources]="sources">
    <ng-template kendoCitationBodyTemplate let-source>
        <h6>{{ source.title }}</h6>
        <p>{{ source.description }}</p>
    </ng-template>
</kendo-citation>
```

Use the [`icon`](https://www.telerik.com/kendo-angular-ui-develop/components/conversational-ui/api/citationcomponent#icon) or [`svgIcon`](https://www.telerik.com/kendo-angular-ui-develop/components/conversational-ui/api/citationcomponent#svgicon) property to customize the icon rendered inside the Citation chip. Set the [`sourceIcon`](https://www.telerik.com/kendo-angular-ui-develop/components/conversational-ui/api/citationcomponent#sourceicon) or [`sourceSVGIcon`](https://www.telerik.com/kendo-angular-ui-develop/components/conversational-ui/api/citationcomponent#sourcesvgicon) property to customize the icon rendered before the source URLs inside the popover.

```html
<kendo-citation
    [sources]="sources"
    [svgIcon]="bookIcon"
    [sourceSVGIcon]="globeIcon"
></kendo-citation>
```

## See Also

* [LLM Kit Overview](https://www.telerik.com/kendo-angular-ui-develop/components/conversational-ui/llm-kit)
* [API Reference of the CitationComponent](https://www.telerik.com/kendo-angular-ui-develop/components/conversational-ui/api/citationcomponent)
