How to get the display density in a lightning components controller?

Is it possible to see if a user is in Comfy or Compact display density in a lightning controller? This is a new feature since Winter ’19 and I cant find any documentation about this.

Answer

You can get Display density information using Salesforce User Interface API. This Link will help you. I don’t think you can directly access Salesforce UI-API from Lightning controller, but you can use Apex class to achieve this.

Attribution
Source : Link , Question Author : Robin Weymans , Answer Author : Arun

Leave a Comment