Skip to main content

@api

Explore practical guides and implementation patterns for this topic.

Posts

Lightning Web Components

Mastering LWC Decorators: @api, @track, and @wire Explained

💬 In Plain Words: Three decorators, three specific jobs. @api makes a property public so the parent component can control it. @track forces a re-render when you change data inside an object or array. @wire automatically pulls data from Salesforce and refreshes whenever its inputs change. Everything else is just a plain field—and remember, plain fields in modern LWC are already reactive!
Read article
Topic LWC
Lightning Web Components

Mastering Communication in Salesforce Lightning Web Components (LWC)

In plain words: In Lightning Web Components (LWC), data flows down and events flow up . A parent passes data to a child through public @api properties, and can call a child's public @api methods. A child can't change the parent's data directly, so it sends a custom event with dispatchEvent , and the parent decides what to do with it. Real Salesforce apps are built from many small components that work together. To keep them clean and reusable, each component needs clear rules for how it talks to the others. This post covers both directions, parent to child and child to parent, using one simple example: a parent shows a product, and a child lets the user pick a quantity and add it to a cart.
Read article
Topic LWC
Lightning Web Components

Salesforce LWC Component Communication Masterclass: Parent, Child, LMS & External APIs

In plain words: Component communication in Salesforce Lightning Web Components (LWC) is how different parts of a screen share data and talk to each other. Depending on how components are related, developers use public properties ( @api ) to send data downward, custom events to notify parents upward, Lightning Message Service (LMS) for distant components, and Lightning Data Service (LDS) for automated database sync. Building rich, interactive user interfaces in Salesforce rarely involves a single standalone component. Most enterprise applications rely on modular architectures where multiple components collaborate to display and modify data. Mastering the various communication channels available in LWC ensures your applications remain performant, modular, and maintainable.
Read article