> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superdoc.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Bookmarks extension

Create invisible navigation anchors for cross-references and document navigation.

Essential for long documents, table of contents, and internal hyperlinks with perfect Word compatibility.

## OOXML Structure

```xml theme={null}
<!-- Bookmark start and end tags -->
<w:bookmarkStart w:id="0" w:name="chapter1"/>
<w:r>
  <w:t>Chapter content here</w:t>
</w:r>
<w:bookmarkEnd w:id="0"/>

<!-- Hyperlink to bookmark -->
<w:hyperlink w:anchor="chapter1">
  <w:r>
    <w:t>Go to Chapter 1</w:t>
  </w:r>
</w:hyperlink>
```

## Use case

* **Table of Contents** - Create clickable TOC entries that jump to chapters
* **Cross-References** - Link to figures, tables, or sections elsewhere
* **Navigation** - Quick jumps in long documents without scrolling
* **Index Creation** - Mark important terms for automated index generation
* **Document Automation** - Programmatic navigation and content updates

## Commands

### `insertBookmark`

Insert a bookmark at the current cursor position. Bookmarks are invisible navigation anchors used for cross-references and document navigation.

**Example:**

```javascript Usage theme={null}
editor.commands.insertBookmark({ name: 'chapter1' })
editor.commands.insertBookmark({ name: 'introduction', id: 'intro-001' })
```

```javascript Full Example theme={null}
import { SuperDoc } from 'superdoc';
import 'superdoc/style.css';

const superdoc = new SuperDoc({
  selector: '#editor',
  document: yourFile,
  onReady: (superdoc) => {
    const editor = superdoc.activeEditor;
    editor.commands.insertBookmark({ name: 'chapter1' })
    editor.commands.insertBookmark({ name: 'introduction', id: 'intro-001' })
  },
});
```

**Parameters:**

**config** `Object` *required*

Object with `name` (required bookmark name) and optional `id` (unique identifier)

### `goToBookmark`

Navigate to a bookmark by name. Scrolls the document to the bookmark position.

**Example:**

```javascript Usage theme={null}
editor.commands.goToBookmark('chapter1')
```

```javascript Full Example theme={null}
import { SuperDoc } from 'superdoc';
import 'superdoc/style.css';

const superdoc = new SuperDoc({
  selector: '#editor',
  document: yourFile,
  onReady: (superdoc) => {
    const editor = superdoc.activeEditor;
    editor.commands.goToBookmark('chapter1')
  },
});
```

**Parameters:**

**name** `string` *required*

Bookmark name to navigate to

## Attributes

### BookmarkStart

**name** `string`

Bookmark name for cross-references and navigation

**id** `string`

Unique identifier for the bookmark

### BookmarkEnd

**id** `string`

Identifier matching the corresponding bookmarkStart

## Source code

[View on GitHub →](https://github.com/superdoc/docx-editor/tree/main/packages/super-editor/src/editors/v1/extensions/bookmarks/bookmark-start.js)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.