# Accessibility

Provides bounded input context and segmented reading on a mounted view. Localize labels and supply semantics for custom blocks.

Provides bounded input context and segmented reading on a mounted view. Localize labels and supply semantics for custom blocks.

`@quirekit/accessibility` · **AGPL-3.0-only**

## Editor compatibility
Layer：**Shared document capability**
| Editor | Status | Assembly and boundaries |
| --- | --- | --- |
| Classic | Requires integration | Connect the services, targets and lifecycle described on this page and validate the selected View and document model. Core contracts are reusable, but there is no universal product installation without host ports. |
| Block | Requires integration | Connect the services, targets and lifecycle described on this page and validate the selected View and document model. Core contracts are reusable, but there is no universal product installation without host ports. |

“Supported” means the product assembly above exists; interaction, host services and file formats retain their own conditions. See [status and integration rules](/en/plugins/compatibility). Licensing is shown separately.

## Installation

```sh
pnpm add @quirekit/accessibility@alpha
```

Install in Editor extensions. The host supplies a view, container and persistence; see [Quick start](/en/guide/quick-start).

```ts
import { Accessibility } from '@quirekit/accessibility'
```

Use compatible versions available from your distribution source. This site uses the Alpha workspace. License labels come from package metadata; see [support and licensing](/en/support).

## Integration by editor

These snippets use an existing host element named element. The host owns container sizing and persistence; call instance.destroy() on teardown. Avoid duplicating preset capabilities and supply required host ports before installation.

### Classic

Connect the services, targets and lifecycle described on this page and validate the selected View and document model. Core contracts are reusable, but there is no universal product installation without host ports.

### Block

Connect the services, targets and lifecycle described on this page and validate the selected View and document model. Core contracts are reusable, but there is no universal product installation without host ports.

## Configuration

These are extension-level defaults. Presets can override them; they are distinct from current document attributes. See [configuration](/en/plugins/configuration).

### enabled

Initial enabled state; installation is always explicit.

Type：`boolean`

Default：`true`

### textBudget

Maximum UTF-16 units in the active paragraph context.

Type：`number`

Default：`2048`

### readingBudget

Maximum UTF-16 units in one explicit reading segment.

Type：`number`

Default：`8192`

### readingBlocks

Maximum leaf items in one segment; structural traversal also has a depth and step bound.

Type：`number`

Default：`40`

### labels

Localizable UI and announcements.

Type：`QuireAccessibilityLabels`

Default：See default below

```ts
{ input: "文档编辑（当前段落上下文）", reading: "阅读文档", returnToEditor: "返回编辑器", previous: "上一段阅读内容", next: "下一段阅读内容", edit: "编辑此段", empty: "空段落", continuation: "（段落续文）", unavailable: "当前范围暂不支持文本上下文或直接编辑。", unsupported: (name) => `此区块暂未提供阅读语义：${name}`, segment: (index, last) => `阅读分段 ${index}${last ? "，已到文档末尾" : "，后面还有内容"}` }
```

### describeBlock

Describe custom blocks for accessible reading when the block has no built-in semantic contribution.

Type：`(node: Node): QuireAccessibleBlockDescription | null`

Default：`(node) => node.isTextblock ? { kind: "paragraph" } : null`

## Commands and runtime

This entry declares no directly enumerable commands. Children supply bundle commands; product plugins use contributions or document services.

## Next steps

Return to [all plugins](/en/plugins), or read [configuration](/en/plugins/configuration) to distinguish options, attributes and commands.

See [extension development](/en/build/extension) for custom capabilities and [Build a product](/en/build) for complete hosting.
