How to load dynamic data in the lightbox

I hope that after the user clicks on the menu, a light box will pop up to display specific coffee customization items, such as cold drinks/hot drinks, sugar/milk and so on. I save all these items in the database of the menu. How can I make the lightbox load it dynamically?

The method I use now is to save the name of the coffee in a database when the user clicks, read this data when opening the light box, and then load the corresponding content. But this leads to a long delay when the light box is turned on. Is there any way to solve this delay or other methods that can dynamically load data?