Caution
This repository has been archived. It is no longer actively maintained or updated.
Development has been moved to a new project: [y-comments] 👉 y-comments
Comments feature for Blocknote.
A demo is worth a thousand words
Get the package
$ yarn add @defensestation/blocknote-commentsInclude module at your application
import{commentStyleSpec,CommentToolbarController,CreateCommentButton,}from"@defensestation/blocknote-comments";Create schema with comment style spec.
constschema=BlockNoteSchema.create({styleSpecs: {// Adds all default styles.
...defaultStyleSpecs,comment: commentStyleSpec,},});Add comment button in toolbar.
constCustomToolbar=()=>(<FormattingToolbarControllerformattingToolbar={()=>(<FormattingToolbar><CreateCommentButtonkey={"createCommentButtin"}/></FormattingToolbar>)}/>)Add comment controller.
<BlockNoteViewformattingToolbar={false}editor={editor}><CustomToolbar/><CommentToolbarController/></BlockNoteView>