Skip to content

Help needed: Nested Custom Blocks (IF/LOOP) in BlockNote #1368

@Aichnerc

Description

@Aichnerc

Hi there,

I'm exploring the possibility of adding custom blocks (e.g., IF and LOOP) to BlockNote with the following functionality:

  1. Custom Blocks:

    • Blocks (IF and LOOP) that include a single-line input field for parameters (e.g., x > 5 or while i < 10).
    • Full editor functionality inside these blocks (text, headings, images, etc.).
  2. Nesting:

    • Support for nesting IF and LOOP blocks within each other or within other content in the editor.
  3. Slash Menu Integration:

    • Allow IF and LOOP to be added directly via the slash menu.
  4. Styling:

    • Visually distinguish these blocks with borders or other styles.

Additional Context

This functionality is similar to how callouts work in Notion, where you can add any type of content within a callout block. I’m aiming for a similar behavior, but with custom blocks (IF and LOOP) that include an input field for parameters.

Notion_SJ8R9gtvmE.mp4

Questions

  • Is it possible to implement custom blocks with nested editor functionality using the current BlockNote framework?
  • Can the BlockSchema API support this kind of nesting structure?
  • Do you have any guidance or best practices for dynamically rendering and managing nested blocks within the editor?

Both Devin and Replit failed to help me design this.

Thank you in advance for your help! I’d love to know if this aligns with the capabilities of BlockNote or if there are any limitations I should be aware of.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions