--- page: 'reference-detail' title: 'ons-if-orientation' name: 'ons-if-orientation' collection: 'components' reference: true docCategory: 'js' componentCategory: util ---

ons-if-orientation

Conditionally display content depending on screen orientation. Valid values are portrait and landscape. Different from other components, this component is used as attribute in any element.

Usage #

<div ons-if-orientation="portrait">
  <p>This will only be visible in portrait mode.</p>
</div>

See also #

Attributes #

Name Type
Default Value
Description
ons-if-orientation String Either "portrait" or "landscape". Optional

Discussion #