+ 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!!

( https://developer.salesforce.com/docs/component-library/bundle/lightning-progress-indicator/example)
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