> ## Documentation Index
> Fetch the complete documentation index at: https://react-docx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sequence

Automatic numbering for captions such as "Photo 1", "Figure 2" or "Table 3", as a Word sequence field.

```tsx theme={"dark"}
<Paragraph className="text-xs text-gray-600">
  Photo <Sequence name="Photo" />: {photo.caption}
</Paragraph>
```

***

## Props

| Prop   | Type     | Description                                |
| ------ | -------- | ------------------------------------------ |
| `name` | `string` | Sequence name. Each name counts separately |

Names use letters, digits and underscores and start with a letter (`Photo`, `Figura`, `Table_A`).

***

## Why a field

The number is a Word `SEQ` field, not fixed text. When someone inserts or deletes a numbered item in Word and updates fields (F9, printing, or on open with `updateFieldsOnOpen`), the numbers follow. A hard-coded `Photo {index}` would go stale after the first manual edit.

React DOCX also writes the current number into the field, so the document reads correctly before any update and in viewers that never update fields.

***

## Several sequences

```tsx theme={"dark"}
<Paragraph>Figure <Sequence name="Figure" /> — Site plan</Paragraph>
<Paragraph>Table <Sequence name="Table" /> — Measurements</Paragraph>
<Paragraph>Figure <Sequence name="Figure" /> — Detail</Paragraph>
```

Produces Figure 1, Table 1, Figure 2.
