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

# Types: editor: Content controls

## `ContentControlCommand`

Content controls (`w:sdt`). `insertContentControl` wraps the selection: runs of
one paragraph become an inline control, whole paragraphs a block one; a
collapsed caret gets an empty control showing placeholder text. The other
commands name a control by the id `contentControls()` reports. Legacy form
fields (FORMDROPDOWN, FORMCHECKBOX, FORMTEXT) list there too, with `legacy`
set, so one picker serves both generations; only `toggleCheckbox` and
`selectListItem` accept them.

Not exported by name. You get it from the API.

```ts theme={null}
type ContentControlCommand = { kind: "insertContentControl"; tag?: string; title?: string; type: InsertableControlKind } | { id: string; kind: "removeContentControl" } | { cannotDelete?: boolean; cannotEdit?: boolean; dateFormat?: string; id: string; kind: "contentControlProps"; tag?: string; title?: string } | { checked?: boolean; id: string; kind: "toggleCheckbox" } | { id: string; index: number; kind: "selectListItem" } | { date: string; id: string; kind: "selectDate" }
```

## `ContentControlInfo`

A content control (`w:sdt`) of the body, in the offset space `EditorHost.text` uses.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `cannotDelete` | `boolean` | |
| `cannotEdit` | `boolean` | `w:lock` forbids typing inside (contentLocked) or removing the control (sdtLocked). |
| `checked?` | `boolean` | Set for a checkbox. |
| `date?` | `{ format: string; locale?: string; value?: string }` | A date picker's stored day (`w:fullDate` as YYYY-MM-DD), its Word picture and `w:lid`. |
| `gallery?` | `string` | `w:docPartGallery` of a building block, e.g. "Table of Contents". |
| `id` | `string` | `w:id`, or `#n` when the part carries none. |
| `items?` | `{ text: string; value: string }[]` | The choices of a combo box or dropdown list. |
| `kind` | `ContentControlKind` | |
| `legacy?` | `true` | A legacy form field (`w:fldChar` + `w:ffData`) projected as a control: no props, no removal. |
| `level` | `ContentControlLevel` | |
| `parentId?` | `string` | The enclosing control's id when nested. |
| `placeholder` | `boolean` | The control still shows its placeholder text (`w:showingPlcHdr`). |
| `range?` | `ReviewRange` | Absent when the control holds no editable text (an empty cell-level or deleted one). |
| `selected?` | `number` | The item whose text the control shows; absent when none matches. |
| `tables?` | `ControlTable[]` | Tables a block control holds whole, named by their cells' address; Word frames their box, not their text. |
| `tag?` | `string` | |
| `title?` | `string` | `w:alias`: the label Word shows on the control's tab. |

## `ContentControlKind`

What a `w:sdt` is for, read from its `w:sdtPr` marker; rich text when it carries none.

Not exported by name. You get it from the API.

```ts theme={null}
type ContentControlKind = "richText" | "plainText" | "checkBox" | "comboBox" | "dropDownList" | "datePicker" | "picture" | "buildingBlockGallery" | "repeatingSection" | "group" | "unknown"
```

## `ContentControlLevel`

Inline sits among a paragraph's runs; block wraps paragraphs or tables; row and cell wrap table parts.

Not exported by name. You get it from the API.

```ts theme={null}
type ContentControlLevel = "inline" | "block" | "row" | "cell"
```

## `ControlTable`

A table by the `bodyIndex` and `path` every one of its cell targets carries.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `bodyIndex` | `number` | |
| `path?` | `CellPathStep[]` | |

## `InsertableControlKind`

The kinds a new control can take; the rest are read-back detections.

Import from `@reductoai/docx-editor`, `@reductoai/docx-editor/model`.

```ts theme={null}
type InsertableControlKind = "richText" | "plainText" | "checkBox" | "datePicker"
```
