Adding external libraries after dragging custom block
Hi, If you didn't find answer here, you can contact with Devfuture Team: https://devfuture.pro/contact/ We specialise on GrapesJS.
Read full answer below βQuestion
Hi, I am customizing GrapesJS by creating components/blocks my users can drag onto the canvas. A number of these blocks depend upon external libraries like Bootstrap and FontAwesome.. Is there a way to check to see if the necessary dependencies are included on a page, and if not, add them to the page? Here is what I already know. I am hoping that someone can help me fill in the gaps of my GrapesJS understanding, or point me in a helpful direction.I am aware that I can tap into drag and drop events when a user places a block on a page. However, I can only tap into the 'block:drag:stop' event f...
Answers (3)
Hi,
If you didn't find answer here, you can contact with Devfuture Team: https://devfuture.pro/contact/
We specialise on GrapesJS.
@stljeff1 the correct way is to use Component related scripts which check if the dependency exists
@artf Can I do that with CSS files? Nonetheless, I did manage to "solve" my problem by creating a custom type for the blocks with any kind of dependency (CSS or JS). This custom type extends the default view by adding a custom callback when blocks of that type are placed on canvas. When this callba...
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3223
FEAT: Create the canvas from a URL
I've been playing with GrapesJS and trying to integrate it into a Symfony 5 project. In particular I want to be able to edit templates in t...
Issue #809
[Bug]: CSS not added when blocks are drag and dropped after core:canvas-clear command invoked
I'm using grapesjs-blocks-basic plugin that has a number of column blocks. When I drag and drop these blocs onto the canvas they are displa...
Issue #1420
Customizing Block(section block) While Dragging it
Hi I have seen that there was two separate blocks to add 'sections' and 'columns'.We have a flow like when we drag a section into canvas ne...
Issue #1492
Creating Custom Multiple Block Managers
Is there a way to generate multiple block managers where you click on a command button and a set on specific components are listed in the v...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins βPremium plugins ship with support, regular updates, and production-ready features β save days of integration work.
Browse premium plugins βRelated tutorials
In-depth guides on the same topic.
Tutorial
How to Build a Production GrapesJS Editor: The Complete Walkthrough of Brief, Preset, Plugins, and Services
A complete walkthrough of building a production GrapesJS editor: how to choose a preset, pick plugins, and scope setup services without burning a sprint.
Tutorial
Embed GrapesJS in Your SaaS: A Weekend Guide
Embed GrapesJS in your SaaS and ship a white-label page builder over a weekend. Honest tradeoffs, real code, and the plugins that close the UX gap.
Tutorial
GrapesJS vs Webflow vs Builder.io vs Puck: Which Visual Builder to Choose in 2026
A practitioner's 2026 comparison of GrapesJS, Webflow, Builder.io, and Puck β pricing, AI features, lock-in, and a one-line rule for picking the right one
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.