function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

How to hide a Lightning Web Component (LWC) component if the current browser is mobile phone?


I am using Progress Indicator component. But I want to hide this if user is accesing the page from mobile or tablet. What is the best way to do that? Thanks in adcance!!

Ankit RathorAnkit Rathor
Hi IamSRN,

Please try this code:

Aura Component

<aura:component  access="global" >
    <aura:if isTrue="{!$Browser.formFactor == 'DESKTOP'}">
        <c:progressBarComponent/> <!--LWC Component-->

User-added image
User-added image
I hope it helps you.

Please let me know if you have any other query and If this solution is helpful then please mark it as Best Answer.

Ankit Rathor