---
title: "Build a review sidebar"
description: "Use citation queries and subscriptions to keep a review sidebar up to date."
canonical_url: "https://tiptap.dev/docs/citations/guides/review-sidebar"
---

# Build a review sidebar

Use citation queries and subscriptions to keep a review sidebar up to date.

Render the review queue from a [configured Smart Citations editor](https://tiptap.dev/docs/citations/getting-started/install.md), then refresh it when citations change. Call the returned unsubscribe function when the sidebar unmounts.

Try the sidebar in the [Smart Citations demo](https://tiptap.dev/docs/citations/getting-started/overview.md). Use **Show citations** to filter the list, then open a citation to jump to it and see the review actions.

```ts
import type { Editor } from '@tiptap/core'
import { getCitation, getCitations, subscribeCitations } from '@tiptap-pro/extension-smart-citations'
import type { Citation } from '@tiptap-pro/extension-smart-citations'

function watchReviewQueue(editor: Editor, render: (citations: readonly Citation[]) => void) {
  const refresh = () => render(getCitations({ editor, filter: { status: 'invalid' } }))
  refresh()
  return subscribeCitations({ editor, listener: refresh })
}

function goToCitation(editor: Editor, id: string) {
  const citation = getCitation({ editor, id })
  const range = citation?.ranges[0]
  if (!citation || !range) return

  const chain = editor.chain().focus()
  if (citation.kind === 'node') {
    chain.setNodeSelection(range.from)
  } else {
    chain.setTextSelection(range)
  }
  chain.scrollIntoView().run()
}
```

Keep the citation ID on each row. Several citations can share a source ID. Pass the citation ID to `goToCitation` and the [review commands](https://tiptap.dev/docs/citations/api-reference/commands.md). Read fresh ranges on click because edits can move or remove a citation. The example navigates to the first surviving range.

Use [citation clicks](https://tiptap.dev/docs/citations/guides/rendering.md) to open the relevant review item when a user clicks a citation.
