Loading Dynamic Content on Opening Bootstrap Modals with Stimulus JS

Phil Smy
5 min readJul 10, 2023

When working on a recent project for Zonmaster.com, I encountered a requirement that called for loading dynamic data into a Bootstrap 5 modal every time it was opened. By default, Bootstrap modals are rendered during the page load and remain static thereafter, which can cause performance issues if the modal’s content is resource-intensive. To overcome this limitation and…

--

--

Phil Smy

Thinker, musician, writer and chief cook and code washer at ZonMaster.com. He’s also a published fiction author.