0

SLOTS in Salesforce LWC

What are some real time use cases of implementing slots in salesforce lightning web components

1 Answer 1

1

The "real use case" you are asking for depends on who and why someone would use this. In this lightning-card example, the footer might be present or not, it might contain a different text, or buttons. Same thing with the actions: they might be there or not.

Imagine a scenario where your component evaluates the permissions a current user has, or evaluates some criteria with a record on the database, and uses this as the condition to show a specific thing on the footer, or enable/disable a specific action.

At the end, slots help with composition of components.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .