# StarterKit · 基础编辑预设

一次安装常用节点、文字标记和基础编辑行为。每个子项可配置或设为 false；同一扩展不要再单独重复安装。

一次安装常用节点、文字标记和基础编辑行为。每个子项可配置或设为 false；同一扩展不要再单独重复安装。

`@quirekit/starter-kit` · **MIT**

## 编辑器适用范围
层次：**共享文档能力**
| 编辑器 | 状态 | 所需装配与边界 |
| --- | --- | --- |
| Classic | 直接支持 | [classicEditorPreset](/plugins/reference/classic-editor-preset) — 使用产品中立的 classicEditorPreset；已有能力由预设装配，不要重复追加。Word 预设会替换段落、标题和容器列表，不能把通用结构直接叠加到 Word 模型。 |
| Block | 直接支持 | [createBlockEditorPreset](/plugins/reference/create-block-editor-preset) — createBlockEditor 默认预设已装配此能力。通过 preset 中对应子项配置；图形编辑使用预设注入的工作区，宿主仍负责保存和资源。不要重复安装同名扩展。 |

“直接支持”指已有上述产品装配；具体交互、宿主服务和格式支持仍有各自条件。[状态与接入规则](/plugins/compatibility)。许可独立显示。

## 接入

```sh
pnpm add @quirekit/starter-kit@alpha
```

在创建 Editor 时放入 `extensions`。挂载容器、视图和保存由宿主提供，见[快速开始](/guide/quick-start)。

```ts
import { StarterKit } from '@quirekit/starter-kit'

const starter = StarterKit.configure({
  heading: { levels: [1, 2, 3] },
  undoRedo: false,
})
```

安装时按包声明选择兼容版本，外部可用版本以分发源为准。本站使用工作区 Alpha；许可标签来自入口所属包，使用条件见[支持与许可](/support)。

## 按编辑器接入

以下片段沿用已挂载的宿主元素 `element`，宿主负责容器尺寸与保存；退出页面时调用 `instance.destroy()`。已有预设装配的能力不要再重复追加；需要宿主端口的入口应先完成下方配置。

### Classic

使用产品中立的 classicEditorPreset；已有能力由预设装配，不要重复追加。Word 预设会替换段落、标题和容器列表，不能把通用结构直接叠加到 Word 模型。

[classicEditorPreset](/plugins/reference/classic-editor-preset)

```ts
import { createClassicEditor } from '@quirekit/classic-editor'
import '@quirekit/classic-editor/styles.css'

const instance = createClassicEditor({ element })
```

### Block

createBlockEditor 默认预设已装配此能力。通过 preset 中对应子项配置；图形编辑使用预设注入的工作区，宿主仍负责保存和资源。不要重复安装同名扩展。

[createBlockEditorPreset](/plugins/reference/create-block-editor-preset)

```ts
import { createBlockEditor } from '@quirekit/block-editor'
import '@quirekit/block-editor/styles.css'

const instance = createBlockEditor({
  element,
  content: { type: 'doc', content: [{ type: 'paragraph' }] },
})
```

## 配置

下面是扩展自身的默认选项。预设可以覆盖这些值；它们不等于当前文档属性。配置方法见[配置插件](/plugins/configuration)。

### document

配置 Document 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<object>`

默认：`undefined`

子扩展的具体选项见 [Document](/plugins/reference/document)。是否可以设为 false，以本字段类型为准。

### paragraph

配置 Paragraph 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<ParagraphOptions>`

默认：`undefined`

子扩展的具体选项见 [Paragraph](/plugins/reference/paragraph)。是否可以设为 false，以本字段类型为准。

### text

配置 Text 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<object>`

默认：`undefined`

子扩展的具体选项见 [Text](/plugins/reference/text)。是否可以设为 false，以本字段类型为准。

### blockquote

配置 Blockquote 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<BlockquoteOptions>`

默认：`undefined`

子扩展的具体选项见 [Blockquote](/plugins/reference/blockquote)。是否可以设为 false，以本字段类型为准。

### hardBreak

配置 HardBreak 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<HardBreakOptions>`

默认：`undefined`

子扩展的具体选项见 [HardBreak](/plugins/reference/hard-break)。是否可以设为 false，以本字段类型为准。

### heading

配置 Heading 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<HeadingOptions>`

默认：`undefined`

子扩展的具体选项见 [Heading](/plugins/reference/heading)。是否可以设为 false，以本字段类型为准。

### horizontalRule

配置 HorizontalRule 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<HorizontalRuleOptions>`

默认：`undefined`

子扩展的具体选项见 [HorizontalRule](/plugins/reference/horizontal-rule)。是否可以设为 false，以本字段类型为准。

### bold

配置 Bold 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<BoldOptions>`

默认：`undefined`

子扩展的具体选项见 [Bold](/plugins/reference/bold)。是否可以设为 false，以本字段类型为准。

### code

配置 Code 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<CodeOptions>`

默认：`undefined`

子扩展的具体选项见 [Code](/plugins/reference/code)。是否可以设为 false，以本字段类型为准。

### codeBlock

配置 CodeBlock 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<CodeBlockOptions>`

默认：`undefined`

子扩展的具体选项见 [CodeBlock](/plugins/reference/code-block)。是否可以设为 false，以本字段类型为准。

### bulletList

配置 BulletList 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<BulletListOptions>`

默认：`undefined`

子扩展的具体选项见 [BulletList](/plugins/reference/bullet-list)。是否可以设为 false，以本字段类型为准。

### listItem

配置 ListItem 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<ListItemOptions>`

默认：`undefined`

子扩展的具体选项见 [ListItem](/plugins/reference/list-item)。是否可以设为 false，以本字段类型为准。

### listKeymap

配置 ListKeymap 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<ListKeymapOptions>`

默认：`undefined`

子扩展的具体选项见 [ListKeymap](/plugins/reference/list-keymap)。是否可以设为 false，以本字段类型为准。

### orderedList

配置 OrderedList 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<OrderedListOptions>`

默认：`undefined`

子扩展的具体选项见 [OrderedList](/plugins/reference/ordered-list)。是否可以设为 false，以本字段类型为准。

### italic

配置 Italic 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<ItalicOptions>`

默认：`undefined`

子扩展的具体选项见 [Italic](/plugins/reference/italic)。是否可以设为 false，以本字段类型为准。

### strike

配置 Strike 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<StrikeOptions>`

默认：`undefined`

子扩展的具体选项见 [Strike](/plugins/reference/strike)。是否可以设为 false，以本字段类型为准。

### underline

配置 Underline 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<UnderlineOptions>`

默认：`undefined`

子扩展的具体选项见 [Underline](/plugins/reference/underline)。是否可以设为 false，以本字段类型为准。

### gapcursor

配置 Gapcursor 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<object>`

默认：`undefined`

子扩展的具体选项见 [Gapcursor](/plugins/reference/gapcursor)。是否可以设为 false，以本字段类型为准。

### trailingNode

配置 TrailingNode 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<TrailingNodeOptions>`

默认：`undefined`

子扩展的具体选项见 [TrailingNode](/plugins/reference/trailing-node)。是否可以设为 false，以本字段类型为准。

### baseKeymap

配置 BaseKeymap 子扩展；允许 false 时可关闭此项。

类型：`boolean`

默认：`undefined`

子扩展的具体选项见 [BaseKeymap](/plugins/reference/base-keymap)。是否可以设为 false，以本字段类型为准。

### undoRedo

配置 UndoRedo 子扩展；允许 false 时可关闭此项。

类型：`StarterKitExtensionOption<UndoRedoOptions>`

默认：`undefined`

子扩展的具体选项见 [UndoRedo](/plugins/reference/undo-redo)。是否可以设为 false，以本字段类型为准。

## 命令与运行方式

此入口没有直接声明可枚举的命令。组合扩展的命令由子扩展提供；产品插件通过 contribution 或文件服务工作。不能把安装入口名称当作命令调用。

## 下一步

返回[全部插件](/plugins)，或阅读[配置插件](/plugins/configuration)区分配置、文档属性与命令。

自己定义能力时见[扩展开发](/build/extension)；搭建完整宿主时见[构建产品](/build)。
