Create a reusable popup component with dynamic button actions

Hey, I was wondering if it’s possible to turn our popup element into a reusable component. We use these popups in various parts of the app, and they all look similar. They have two buttons at the bottom, text content, a title, and a close button in the header, as shown in the screenshot.

I’m struggling to visualize how to make this a reusable element because the action button (in red) at the bottom runs different actions based on where the popup is used. Is there a way to create a single reusable popup element that can handle different actions for the button?

I’m looking for some guidance on how to achieve this. Thank you!

1 Like

Hi @gabriel.guerin

This video may help you.

@gloriaui, thank you! This is exactly what I needed and I have already started implementing it in my app. I can’t believe I didn’t find this video while searching for a solution - maybe the word I was missing was modular or modularity. Anyway, thanks a lot!

1 Like

You’re welcome! :grinning:

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.