Adding DOM Attributes
BlockNote allows you to add custom HTML attributes to various DOM elements within the editor. This gives you fine-grained control over styling and functionality.
Available DOM Elements
The following DOM elements can receive custom attributes:
editor
: The main editor container, excluding menus & toolbarsblock
: The container element for individual blocksblockGroup
: Wrapper for top-level and nested blocksblockContent
: Wrapper for a block's contentinlineContent
: Wrapper for rich-text content within blocks
Example Usage
The demo below shows how to add a custom class to the block
element to create a border around each block: