When developing Aura components in Lightning Experience, you can use the Overlay Library to create a popover (via showCustomPopover()
).
Is there an equivalent for LWC, or can I only use this library in an Aura component? If the latter, is there any kind of workaround, like wrapping the LWC component in an Aura component?
Note: in my case, this is being used inside a LWC that is within an Aura component, so unfortunately I can't use slots. Perhaps this would be a reason to develop the parent component as an Aura component.
Best Answer
You can refer to the SLDS Modal Blueprint to achieve the exact same thing, furthermore, you can create a "reusable" modal lwc component such as this one (which uses the slds blueprint I linked)
and you can use it in your components as follows:
the js part should be fairly easy to implement (toggle the modal - displa-hide) and you can implement additional functionalities.