Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Aichnerc opened this issue Jan 13, 2025 · 7 comments
Closed

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

Aichnerc opened this issue Jan 13, 2025 · 7 comments
Labels
enhancement New feature or request

Comments

@Aichnerc
Copy link

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.

@Aichnerc Aichnerc added the enhancement New feature or request label Jan 13, 2025
@nperez0111
Copy link
Contributor

See this example for implementing a custom block type: https://www.blocknotejs.org/docs/custom-schemas/custom-blocks

@Aichnerc
Copy link
Author

See this example for implementing a custom block type: https://www.blocknotejs.org/docs/custom-schemas/custom-blocks

Yes, custom blocks are straightforward—I’ve worked with them extensively. The real challenge arises when trying to embed a fully functional editor within a block.

@simonprast
Copy link

+1

@coxato
Copy link

coxato commented Jan 24, 2025

same question.
Any update about this, or this #1267 ??

@ClementNerma
Copy link

I currently have the same need, but nested custom blocks don't seem to be possible as of the current v0.25.2 version.
Any plan on supporting this? :)

@coxato
Copy link

coxato commented Mar 17, 2025

I currently have the same need, but nested custom blocks don't seem to be possible as of the current v0.25.2 version. Any plan on supporting this? :)

Hi @ClementNerma, there is no changes yet, I just created an example here #1267
because the official maintainer @YousefED asked for a reproduceable error.

let's see if there are updates in the future. Hope this get fixed 🙏

@YousefED
Copy link
Collaborator

YousefED commented Mar 19, 2025

this is currently not possible and not planned (yet). let's track this here: #1540

Feel free to add to the thread what the exact use-cases are

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants