---
title: "Cite nodes"
description: "Attach sources to whole nodes and navigate to node citations."
canonical_url: "https://tiptap.dev/docs/citations/guides/cite-nodes"
---

# Cite nodes

Attach sources to whole nodes and navigate to node citations.

Node citations attach a source to a whole node, such as an image or a paragraph.

## Try an image citation

Select the image and click **Add Citation**. Edit the **Field photo source**, then click **Apply source change** to flag the image citation for review.

> **Interactive demo:** [React](https://embed-pro.tiptap.dev/preview/Extensions/SmartCitationsNodes/React)

## Cite a node in code

Use `createCitation` with a node selection to cite the whole node. In the [install example](https://tiptap.dev/docs/citations/getting-started/install.md), position `0` is immediately before the first paragraph.

```ts
editor.chain().setNodeSelection(0).createCitation({ sourceId: 'manual' }).run()
```

To cite that paragraph without changing the selection, pass its position directly.

```ts
editor.commands.createCitation({ sourceId: 'manual', position: 0 })
```

A node can carry several citations. Queries return `kind: 'node'` and a range that covers the node. Use `setNodeSelection(range.from)` to navigate to it. Use `setTextSelection(range)` for `kind: 'inline'`.

Node citations need review when their source changes or goes missing. Edits to the node update attribution, including changes to its text or attributes. Metadata from Smart Citations, Comments, and Tracked Changes does not count as an edit. Custom nodes must render the supplied HTML attributes to preserve citations in HTML exports.
