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.DEFAULTOrientationLock.ALLOrientationLock.PORTRAITOrientationLock.PORTRAIT_UPOrientationLock.PORTRAIT_DOWNOrientationLock.LANDSCAPEOrientationLock.LANDSCAPE_LEFTOrientationLock.LANDSCAPE_RIGHT
() => Promise<void>
Unlocks screen orientation
() => Promise<Orientation>
Gets current orientationReturns:
Orientation.UNKNOWNOrientation.PORTRAIT_UPOrientation.PORTRAIT_DOWNOrientation.LANDSCAPE_LEFTOrientation.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.