# 引用块 {#blockquote}

Source: [为 React 编辑器添加引用块 · Yurich](https://leeyujoo.com/yurich/zh-cn/features/blockquote/)

Package: [`yurich`](https://www.npmjs.com/package/yurich)

Package version: `0.1.2`

将一段文字设为引用。

## 试一试 {#try-it}

把光标放进示例段落，点击 **引用** 后会得到 `<blockquote>给工具栏起名比做工具栏还费时间。</blockquote>`。

## 添加到编辑器 {#setup}

启用 `Blockquote` 并调用 `toggleBlockquote`。

```tsx
import { EditorContent, EditorProvider, Blockquote, useEditor, useIsActive } from 'yurich';

export function BlockquoteEditor() {
  const editor = useEditor({
    extensions: [Blockquote],
    initialValue: "<p>给工具栏起名比做工具栏还费时间。</p>",
  });
  const active = useIsActive(editor, 'toggleBlockquote');

  return (
    <EditorProvider editor={editor}>
      <button
        type="button"
        aria-pressed={active}
        onMouseDown={event => event.preventDefault()}
        onClick={() => editor.execute('toggleBlockquote')}
      >
        引用
      </button>
      <EditorContent ariaLabel="编辑器" />
    </EditorProvider>
  );
}
```

## 行为说明 {#behavior}

引用样式由应用设置。列表项变成引用时会移出列表。

[功能](https://leeyujoo.com/yurich/zh-cn/features/)
