# Blockquote {#blockquote}

Source: [Add blockquotes to a React editor · Yurich](https://leeyujoo.com/yurich/features/blockquote/)

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

Package version: `0.1.2`

Set a passage apart as a quotation.

## Try it {#try-it}

Place the caret in the sample paragraph and click **Quote**. The output changes to `<blockquote>I spent longer naming the toolbar than building it.</blockquote>`. Toggle again to return to a paragraph.

## Add it to your editor {#setup}

Enable `Blockquote` and call `toggleBlockquote` to style one or more blocks as a quotation.

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

export function BlockquoteEditor() {
  const editor = useEditor({
    extensions: [Blockquote],
    initialValue: "<p>I spent longer naming the toolbar than building it.</p>",
  });
  const active = useIsActive(editor, 'toggleBlockquote');

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

## Behavior to account for {#behavior}

Yurich is headless, so add your own quote styling to the editable area and rendered content. Applying a quote to a list item removes that item from the list.

[Features](https://leeyujoo.com/yurich/features/)
