Skip to main content

expo-screen-orientation

Version: 55.0.6 Expo universal module for managing device’s screen orientation.

Installation

Usage

API Reference

Methods

(orientation: OrientationLock) => Promise<void>
Locks screen to specific orientationLocks:
  • OrientationLock.DEFAULT
  • OrientationLock.ALL
  • OrientationLock.PORTRAIT
  • OrientationLock.PORTRAIT_UP
  • OrientationLock.PORTRAIT_DOWN
  • OrientationLock.LANDSCAPE
  • OrientationLock.LANDSCAPE_LEFT
  • OrientationLock.LANDSCAPE_RIGHT
() => Promise<void>
Unlocks screen orientation
() => Promise<Orientation>
Gets current orientationReturns:
  • Orientation.UNKNOWN
  • Orientation.PORTRAIT_UP
  • Orientation.PORTRAIT_DOWN
  • Orientation.LANDSCAPE_LEFT
  • Orientation.LANDSCAPE_RIGHT
() => Promise<OrientationLock>
Gets current orientation lock setting
() => Promise<PlatformOrientationInfo>
Gets platform-specific orientation info
(lock: OrientationLock) => Promise<boolean>
Checks if device supports specific orientation lock

Event Listeners

(listener: (event: OrientationChangeEvent) => void) => EventSubscription
Listens for orientation changes
() => void
Removes all orientation change listeners

Examples

Video Player (Landscape)

Responsive Layout Based on Orientation

Lock Orientation Toggle

Platform Support

On web, orientation locking uses the Screen Orientation API, which has limited browser support.

Resources