BlockNote icon indicating copy to clipboard operation
BlockNote copied to clipboard

Add a classname to the active block so a custom style can be applied

Open Musettodotcom opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe. It would be nice to be able change the style of the active block (e.g., set a different background color).

Describe the solution you'd like Add a class like active-block when the block becomes active and remove it when it becomes inactive.

Musettodotcom avatar Sep 02 '24 06:09 Musettodotcom

For now, you could use const selectedBlocks = useSelectedBlocks(editor); and check if selectedBlocks matches the block (props.block). Does this help?

Curious to hear what you're building!

YousefED avatar Sep 05 '24 07:09 YousefED

Working on a way for drum and piano teachers to create more complex lessons with video, text, lists, images, and some custom controls we are building for playing back musical patterns and songs, as well as interactive MIDI feedback.

The plan is for BlockNote to serve as the basis for the editor and then write custom components for the interactive music parts.

Musettodotcom avatar Sep 07 '24 00:09 Musettodotcom