# Block (@salmonui/rich-text)

> The Block interface of @salmonui/rich-text: One block. props by type: - paragraph: textAlign?; heading: level (1..6), textAlign?; - numberedListItem: start? (starts a new numbered list); checklistItem: checked; - callout: tone (info | success | warning | danger | neutral); - code: language?; toggle: open?; - image: src, alt?, caption?, width?, height?; - audio: src; video: src, width?, height?; - table: headerRow (first row is header cells), rows (InlineContent[][][], rows of cells), variant? (bordered | striped).

Canonical: https://salmonui.dev/docs/reference/rich-text/Block

```ts
import type { Block } from '@salmonui/rich-text';
```

Entry index: https://salmonui.dev/docs/reference/rich-text (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/rich-text.md).

## Reference

Kind: interface

```ts
interface Block {
    id: string;
    type: BlockType;
    props?: Record<string, unknown>;
    content?: InlineContent[];
    children?: Block[];
}
```

One block. `props` by type:
- paragraph: `textAlign?`; heading: `level` (1..6), `textAlign?`;
- numberedListItem: `start?` (starts a new numbered list); checklistItem: `checked`;
- callout: `tone` (`info` | `success` | `warning` | `danger` | `neutral`);
- code: `language?`; toggle: `open?`;
- image: `src`, `alt?`, `caption?`, `width?`, `height?`;
- audio: `src`; video: `src`, `width?`, `height?`;
- table: `headerRow` (first row is header cells), `rows` (`InlineContent[][][]`, rows of cells), `variant?` (`bordered` | `striped`).

`content` holds the block's own text (absent for image, table, divider,
audio, video; one unmarked text item for code); `children` the nested
blocks (list item sub-items, toggle body, quote and callout body).

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `id` | `id: string;` |  |  |
| `type` | `type: BlockType;` |  |  |
| `props` | `props?: Record<string, unknown>;` | optional |  |
| `content` | `content?: InlineContent[];` | optional |  |
| `children` | `children?: Block[];` | optional |  |
