# MarkdownViewerProps

Source: /tuil/docs/reference/components/structured-viewers/markdown-viewer-props
Locale: en

MarkdownViewerProps component contract.



{/* Generated by tooling/docs/generate-reference.ts. */}

## Type [#type]

```ts
export interface MarkdownViewerProps {
  readonly source: string;
  readonly width?: number;
  readonly selectable?: boolean;
  readonly selectedBlock?: number;
  readonly id?: string;
  readonly label?: string;
  readonly autoFocus?: boolean;
  readonly onSelectedBlockChange?: (index: number) => void | Promise<void>;
  readonly renderBlock?: (node: DocumentNode, index: number) => ReactNode;
}
```

## Members [#members]

| Member                  | Type                                                              | Required | Description                                                                                                     | Related types                                                          |
| ----------------------- | ----------------------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| `source`                | `string`                                                          | Yes      | The `source` member uses the `string` contract.                                                                 | —                                                                      |
| `width`                 | `number \| undefined`                                             | No       | The `width` member uses the `number \| undefined` contract.                                                     | —                                                                      |
| `selectable`            | `boolean \| undefined`                                            | No       | The `selectable` member uses the `boolean \| undefined` contract.                                               | —                                                                      |
| `selectedBlock`         | `number \| undefined`                                             | No       | The `selectedBlock` member uses the `number \| undefined` contract.                                             | —                                                                      |
| `id`                    | `string \| undefined`                                             | No       | The `id` member uses the `string \| undefined` contract.                                                        | —                                                                      |
| `label`                 | `string \| undefined`                                             | No       | The `label` member uses the `string \| undefined` contract.                                                     | —                                                                      |
| `autoFocus`             | `boolean \| undefined`                                            | No       | The `autoFocus` member uses the `boolean \| undefined` contract.                                                | —                                                                      |
| `onSelectedBlockChange` | `((index: number) => void \| Promise<void>) \| undefined`         | No       | The `onSelectedBlockChange` member uses the `((index: number) => void \| Promise<void>) \| undefined` contract. | —                                                                      |
| `renderBlock`           | `((node: DocumentNode, index: number) => ReactNode) \| undefined` | No       | The `renderBlock` member uses the `((node: DocumentNode, index: number) => ReactNode) \| undefined` contract.   | [`DocumentNode`](/tuil/docs/reference/packages/streaming/api/document-node) |

## Source [#source]

[View the secondary source reference](https://github.com/mwillbanks/tuil/blob/main/registry/data-display/rich-content.tsx)
