When we add lightning component to app builder its showing spinner because if there is nothing it keeps loading.

We wanted to show some message if its get opened in App builder in "Preview Mode" is it possible to know if Lightning component is opened in Lightning App builder then show something.

Please suggest and advise.

  • The spinner keeps loading looks like a problem in code or need better error handling.
    – Raul
    Commented Jun 20, 2019 at 14:27

1 Answer 1


No, there's no specific interface or event that specifies that you're in preview mode. What you need to do will depend on circumstances. For example, if you're using force:hasRecordId, you might decide to show dummy data if recordId is null. The documentation also states:

Give your required attributes default values. When a component that has required attributes with no default values is added to the App Builder, it appears invalid, which is a poor user experience.

You should provide enough default values that your component can work out a reasonable preview mode.

You must log in to answer this question.

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