> ## 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.

# @reductoai/docx-editor/react

## `DocxEditor()`

```ts theme={null}
function DocxEditor(props: DocxEditorProps): Element
```

Import from `@reductoai/docx-editor/react`.

## `DocxEditorProps`

A region prop is a React node portaled into the editor's grid where the built-in
would sit: absent renders the built-in, `null` removes the region. The node is
mounted only while the region shows (`progress` during a load, `inspector` while
`model.inspectorVisible`, `contextMenu` while `model.ui.contextMenu.open`).

Import from `@reductoai/docx-editor/react`.

```ts theme={null}
type DocxEditorProps = Omit<DocxEditorOptions, "slots" | "document" | "toolbarItems"> & Partial<Record<SlotName, ReactNode>> & { balloon?: ReactBalloon; className?: string; document?: DocxEditorOptions["document"] | null; onReady?: (model: EditorModel) => void; style?: CSSProperties; toolbarItems?: ReactToolbarItems }
```

## `useObservable()`

```ts theme={null}
function useObservable<T extends Observable>(source: T): T
function useObservable<T extends Observable>(source: T | null): T | null
function useObservable<T extends Observable, S>(
  source: T | null,
  select: (live: T | null) => S,
): S
```

Binds a render to an editor observable.

Without a selector the caller re-renders on every change of `source` or an adopted
child, and the model bumps on each caret move and overlay repaint. A region that
stays mounted, a toolbar say, passes a selector: it re-renders only when the
picked fields change (shallow compare), which is what a Svelte component gets.

Import from `@reductoai/docx-editor/react`.
