Loading...

Modern Salesforce applications frequently rely on popup modals for confirmations, warnings, access control decisions, and destructive actions. However, building modal logic separately inside every Lightning Web Component often leads to duplicated code, inconsistent user experiences, and growing technical debt. This blog introduces a flexible popup modal architecture in Lightning Web Components (LWC) that centralizes modal behavior into a reusable, configurable component.

By supporting dynamic headers, conditional content rendering, action-based events, and centralized state management, this approach enables teams to scale complex UI interactions without sacrificing maintainability or UX consistency. Whether you’re managing access permissions, confirmations, or multi-step workflows, this architecture provides a clean and future-proof solution for Salesforce developers.

Step-by-Step Guide to Build a Reusable Popup Modal Architecture in Salesforce LWC

This guide describes a flexible, reusable, and scalable popup modal architecture built using Lightning Web Components (LWC). The goal is to avoid hard-coding modal logic in every component and instead provide a generic modal component that can be configured and controlled by parent components.

This architecture supports:

  • Dynamic headers, body content, and footers
  • Conditional rendering (radio buttons, checkboxes, warnings, loaders)
  • Action-based communication between parent and modal
  • Centralized state handling
  • Clean separation of concerns

Step 1: Create a Grant Portal Access

Review the selected user’s details and current portal access status. This step provides visibility into existing invoice and admin permissions before initiating the group-level access grant.

pic 01 1

Step 2: Grant Access for Invoice or Admin

Choose the appropriate access level for the user by selecting either ‘Group Invoice Access’ or ‘Group Admin Access’ in the popup modal. Confirm your selection to grant permissions or cancel to exit without making changes.

pic 02 1

 

pic 03 1 1

Step 3: Access Grant for Group Invoice Access

Once confirmed, the system successfully grants Group Invoice Access to the user. A success notification is displayed, and the Current Access section is updated to reflect the newly assigned permissions.

IMAGEpic 04 1

Step 4: Remove the access

Click Remove Group Access to revoke the user’s group-level permissions. Confirm the action in the popup to remove access and update the user’s current access status accord

pic 05

pic 06

Step 5: By clicking the checkbox, we can disable the radio buttons:

When the checkbox is selected, the access-level radio buttons are automatically disabled to prevent selection.

pic 07 1

Source Code

Generic Pop up 

HTML

pic 08 1

pic 09 1

pic 10 1

JS

pic 11

pic 12

CSS

pic 13

pic 14

pic 15

pic 16

pic 17

pic 18

Pop up Parent Component

HTML

pic 19

pic 20

pic 21

JS

pic 22

pic 23

pic 24

pic 25

pic 26

CSS

pic 27

pic 28

pic 29

Watch Live Demo
https://hicdemo-dev-ed.my.salesforce-sites.com/GrantAcessPopupPortal

Conclusion

A flexible popup modal architecture in Lightning Web Components allows Salesforce teams to build reusable, scalable, and predictable UI interactions without duplicating logic across components. By separating modal structure, state, and event handling, this approach improves maintainability, enforces business rules, and ensures a consistent user experience across complex Salesforce applications.

At HIC Global Solutions, our Salesforce services focus on designing scalable LWC architectures, optimizing UI performance, and implementing enterprise-ready design patterns that grow with your business. Whether you’re modernizing existing components or building advanced Salesforce apps from scratch, our experts help you deliver clean, maintainable, and future-ready solutions.

No Data Found.

Related Articles
How to Integrate NikoHealth to Salesforce

Healthcare organizations using NikoHealth often need patient, insurance, order, invoice, and prescription data available inside Salesforce. As data grows, manually updating records across systems becomes difficult and can lead to delays, duplicate work, and data inconsistencies. NikoHealth to Salesforce integration helps solve this challenge by automatically synchronizing data between both platforms. Instead of building custom […]

Read More
Orchestrator vs. Traditional Flows

Businesses use Salesforce automation to reduce manual work, improve efficiency, and automate repetitive business processes. Two commonly used automation approaches inside Salesforce are Traditional Flows and Flow Orchestrator. Traditional Flows are mainly used for simple automation tasks such as updating records, sending notifications, creating tasks, and automating business logic. Flow Orchestrator is designed for more […]

Read More
The Rise of Agentic Government_ What Salesforce’s 2026 Insights Mean for the Future of Public Sector AI

Government technology has often been seen as slower to evolve than the private sector. But Salesforce’s latest research challenges that idea in a big way. In fact, the new findings suggest that public sector organizations may now be moving faster than many businesses when it comes to adopting AI agents and preparing for a more […]

Read More
How To Use Email Service in APEX

Managing approvals, updates, and record changes directly from email can significantly improve efficiency within Salesforce workflows. Instead of logging in, navigating records, and manually updating fields, users can simply respond to emails and trigger automated updates using Email Service in APEX. This approach is especially useful for businesses leveraging Salesforce automation and looking to enhance […]

Read More
Design and Implementation of Salesforce Jira Task Integration 1 1

Businesses have been using Salesforce for CRM operations and Jira for Agile project tracking. However, without integration, teams manually update both systems, leading to data inconsistency and inefficiency.This mechanism establishes a real-time integration between Salesforce and Jira, allowing seamless synchronization of tasks and agile board statuses.  A custom Salesforce dashboard was developed that replicates Jira-style […]

Read More
Dark Mode in Salesforce Enabling It and Creating Theme Ready Lightning Web Components with SLDS 2.0 1 1

With the Winter ’26 release, Salesforce introduced Dark Mode in Lightning Experience. Dark Mode has been introduced as a beta feature in Winter ’26, and at first it was available only for Starter Edition orgs. It is now rolling out further with Spring ’26 to Professional, Enterprise, and Developer editions. To use Dark Mode, Salesforce […]

Read More
Our Location worldwide
Indian Flag India
3rd Floor, A-10, Pegasus Tower, Sector 68, Noida, Uttar Pradesh 201301 +91-1203239658
United States of America Flag USA
333 West Brown Deer Road Unit G – 366 Milwaukee WI, USA 53217 +1(262) 310-7818
United Kingdom Flag UK
7 Bell Yard, London, WC2A 2JR +44 20 3239 9428
Canada Canada
HIC Global Solutions INC
6D - 7398 Yonge St #1124 Thornhill, ON L4J 8J2 Canada +1(262) 310-7818