Need help upgrading to Ionic Framework 4.0? Get assistance with our Enterprise Migration Services EXPLORE NOW



Improve this doc

The showWhen attribute takes a string that represents a platform or screen orientation. The element the attribute is added to will only be shown when that platform or screen orientation is active.

Complements the hideWhen attribute. If the showWhen attribute is used on an element that also has the hideWhen attribute, the element will not show if hideWhen evaluates to true or showWhen evaluates to false. If the hidden attribute is also added, the element will not show if hidden evaluates to true.

View the Platform API docs for more information on the different platforms you can use.


<div showWhen="android">
 I am visible on Android!

<div showWhen="ios">
 I am visible on iOS!

<div showWhen="android,ios">
 I am visible on Android and iOS!

<div showWhen="portrait">
 I am visible on Portrait!

<div showWhen="landscape">
 I am visible on Landscape!


HideWhen API Docs, Platform API Docs