Skip to content

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

Closed

Description

@Musettodotcom

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.

Activity

  1. YousefED commented on Sep 5, 2024

    @YousefED
    Collaborator

    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!

  2. Musettodotcom commented on Sep 7, 2024

    @Musettodotcom
    Author

    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.

  3. added
    needs-triageIssue has not yet been reviewed or classified by maintainers.
    on Feb 3, 2026
  4. locked and limited conversation to collaborators on Feb 25, 2026
  5. converted this issue into a discussion #2520 on Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageIssue has not yet been reviewed or classified by maintainers.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions