+ Start a Discussion
Andy Freeston_LarterAndy Freeston_Larter 

Modal popups

I need to display a Lightning Component in a modal popup form, just like when you click Edit on an Opportunity or Account page. From reading the Aura source code I can see that I need to make use of ui:panel and/or ui:modal as these implement the LDS concept of “Modals” and take care of hiding the page’s scrollbar. I can’t find any examples of how to use them from inside Lightning or Visualforce.
Can anyone assist?

- Andy
Mohith Kumar ShrivastavaMohith Kumar Shrivastava
I wrote a blogpost  on how to do this via lightning components


Also my colleague Jitendra also wrote on how to do this


Hope that gets you some insight into how to achieve this .
Andy Freeston_LarterAndy Freeston_Larter
Thanks for responding. In both cases the code is using LDS to solve the visual layout of the modal component – that’s the easy bit. If you look at the source code for ui:modal you can see it handles much more, transition animation, focus handling, and most importantly the page body scrollbar.
I was wondering if anyone had found a solution that used the native Lightning component ui:modal?
Thanks again.