---
description: Capacitor plugin to lock the screen orientation of the app. It allows you to set the orientation to portrait, landscape, or any other supported mode.
title: Capacitor Screen Orientation Plugin - Capawesome
image: https://capawesome.io/docs/assets/images/social/plugins/screen-orientation.png
---

[ Skip to content](#capawesomecapacitor-screen-orientation) 

[ 🎉 Introducing **Capawesome Platform** — one platform for Live Updates, Native Builds, App Store Publishing, and Insider SDKs.](https://capawesome.io) 

* [  Formbricks ](/docs/plugins/formbricks/)
* [  Geocoder ](/docs/plugins/geocoder/)
* [  Google Sign-In ](/docs/plugins/google-sign-in/)
* [  Grafana Faro ](/docs/plugins/grafana-faro/)
* [  libSQL ](/docs/plugins/libsql/)
* [  Live Update ](/docs/plugins/live-update/)
* [  Managed Configurations ](/docs/plugins/managed-configurations/)
* [  Media Session ](/docs/plugins/media-session/)
* [  ML Kit ](/docs/plugins/mlkit/)
* [  Navigation Bar ](/docs/plugins/navigation-bar/)
* [  NFC ](/docs/plugins/nfc/)
* [  OAuth ](/docs/plugins/oauth/)
* [  Pedometer ](/docs/plugins/pedometer/)
* [  Photo Editor ](/docs/plugins/photo-editor/)
* [  PostHog ](/docs/plugins/posthog/)
* [  Printer ](/docs/plugins/printer/)
* [  Purchases ](/docs/plugins/purchases/)
* [  RealtimeKit ](/docs/plugins/realtimekit/)
* Screen Orientation [  Screen Orientation ](/docs/plugins/screen-orientation/)
* [  Configuration ](#configuration)
* [  Demo ](#demo)
* [  Usage ](#usage)
* [  API ](#api)
* [  Type Aliases ](#type-aliases)
* [  Enums ](#enums)
* [  Changelog ](#changelog)
* [  License ](#license)
* [  Credits ](#credits)
* [  Screenshot ](/docs/plugins/screenshot/)
* [  Secure Preferences ](/docs/plugins/secure-preferences/)
* [  Speech Recognition ](/docs/plugins/speech-recognition/)
* [  Speech Synthesis ](/docs/plugins/speech-synthesis/)
* [  Share Target ](/docs/plugins/share-target/)
* [  Square Mobile Payments ](/docs/plugins/square-mobile-payments/)
* [  SQLite ](/docs/plugins/sqlite/)
* [  Superwall ](/docs/plugins/superwall/)
* [  Torch ](/docs/plugins/torch/)
* [  Wifi ](/docs/plugins/wifi/)
* [  Zip ](/docs/plugins/zip/)
* [  Cloud ](/docs/cloud/)
* [  Live Updates ](/docs/cloud/live-updates/)
* Advanced
* Integrations
* [  Native Builds ](/docs/cloud/native-builds/)
* [  Configuration ](/docs/cloud/native-builds/configuration/)
* [  Environments ](/docs/cloud/native-builds/environments/)
* Guides
* [  Sample Projects ](/docs/cloud/native-builds/sample-projects/)
* [  Troubleshooting ](/docs/cloud/native-builds/troubleshooting/)
* [  Automations ](/docs/cloud/automations/)
* [  Assist ](/docs/cloud/assist/)
* Account
* Organizations
* [  Organization and User Management ](/docs/cloud/organizations/memberships/)
* [  Single Sign-On (SSO) ](/docs/cloud/organizations/sso/)
* [  Teams ](/docs/cloud/organizations/teams/)
* [  Two-Factor Authentication ](/docs/cloud/organizations/two-factor-authentication/)
* [  Integrations ](/docs/cloud/integrations/)
* [  License Keys ](/docs/cloud/license-keys/)
* [  Webhooks ](/docs/cloud/webhooks/)
* [  Pricing ](https://capawesome.io/pricing/)
* [  FAQ ](/docs/cloud/faq/)
* [  Support ](/docs/cloud/support/)
* [  Contributing ](/docs/contributing/)
* [  LLMs ](/docs/llms/)
* [  Insiders ](/docs/insiders/)
* [  License ](https://capawesome.io/legal/eula/)
* [  Support ](/docs/insiders/support/)
* [  FAQ ](/docs/insiders/faq/)
* [  Blog ](/blog/)
* Categories

* [  Configuration ](#configuration)
* [  Demo ](#demo)
* [  Usage ](#usage)
* [  API ](#api)
* [  Type Aliases ](#type-aliases)
* [  Enums ](#enums)
* [  Changelog ](#changelog)
* [  License ](#license)
* [  Credits ](#credits)

# @capawesome/capacitor-screen-orientation[¶](#capawesomecapacitor-screen-orientation "Permanent link")

Capacitor plugin to lock/unlock the screen orientation.

[ ![Deliver Live Updates to your Capacitor app with Capawesome Cloud](../../assets/external/cloud.capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.69628c3f.png) ](https://cloud.capawesome.io/) 

## Features[¶](#features "Permanent link")

We are proud to offer one of the most complete and feature-rich Capacitor plugins for screen orientation control. Here are some of the key features:

* 🖥️ **Cross-platform**: Supports Android, iOS, and Web.
* 🔒 **Orientation locking**: Lock screen to specific orientations.
* 🔓 **Orientation unlocking**: Unlock and restore automatic orientation.
* 📱 **Multiple orientations**: Support for portrait, landscape, and specific orientations.
* 🔄 **Orientation detection**: Get current screen orientation.
* 📢 **Event listeners**: Listen to orientation change events.
* 📐 **Fine-grained control**: Primary and secondary orientation modes.
* 🍎 **iPad support**: Special configuration for iPad orientation locking.
* 🔁 **Up-to-date**: Always supports the latest Capacitor version.

Missing a feature? Just [open an issue](https://github.com/capawesome-team/capacitor-plugins/issues) and we'll take a look!

## Newsletter[¶](#newsletter "Permanent link")

Stay up to date with the latest news and updates about the Capawesome, Capacitor, and Ionic ecosystem by subscribing to our [Capawesome Newsletter](https://cloud.capawesome.io/newsletter/).

## Compatibility[¶](#compatibility "Permanent link")

| Plugin Version | Capacitor Version | Status         |
| -------------- | ----------------- | -------------- |
| 8.x.x          | \>=8.x.x          | Active support |
| 7.x.x          | 7.x.x             | Deprecated     |
| 6.x.x          | 6.x.x             | Deprecated     |
| 5.x.x          | 5.x.x             | Deprecated     |

## Installation[¶](#installation "Permanent link")

You can use our **AI-Assisted Setup** to install the plugin. Add the [Capawesome Skills](https://github.com/capawesome-team/skills) to your AI tool using the following command:

`[](#%5F%5Fcodelineno-0-1)npx skills add capawesome-team/skills --skill capacitor-plugins
`

Then use the following prompt:

`` [](#%5F%5Fcodelineno-1-1) Use the `capacitor-plugins` skill from `capawesome-team/skills` to install the `@capawesome/capacitor-screen-orientation` plugin in my project.
 ``

If you prefer **Manual Setup**, install the plugin by running the following commands and follow the platform-specific instructions below:

`[](#%5F%5Fcodelineno-2-1)npm install @capawesome/capacitor-screen-orientation
[](#%5F%5Fcodelineno-2-2)npx cap sync
`

### iOS[¶](#ios "Permanent link")

#### General[¶](#general "Permanent link")

On iOS you must add the following to your app's `AppDelegate.swift`:

`[](#%5F%5Fcodelineno-3-1)+ import CapawesomeCapacitorScreenOrientation
[](#%5F%5Fcodelineno-3-2)
[](#%5F%5Fcodelineno-3-3)@UIApplicationMain
[](#%5F%5Fcodelineno-3-4)class AppDelegate: UIResponder, UIApplicationDelegate {
[](#%5F%5Fcodelineno-3-5)
[](#%5F%5Fcodelineno-3-6)+ func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
[](#%5F%5Fcodelineno-3-7)+   return ScreenOrientation.getSupportedInterfaceOrientations()
[](#%5F%5Fcodelineno-3-8)+ }
`

#### iPad Orientation Lock[¶](#ipad-orientation-lock "Permanent link")

On iPad, you must add the following to your app's `Info.plist`:

`[](#%5F%5Fcodelineno-4-1)<key>UIRequiresFullScreen</key>
[](#%5F%5Fcodelineno-4-2)<true/>
`

## Configuration[¶](#configuration "Permanent link")

No configuration required for this plugin.

## Demo[¶](#demo "Permanent link")

A working example can be found here: [robingenz/capacitor-plugin-demo](https://github.com/robingenz/capacitor-plugin-demo)

## Usage[¶](#usage "Permanent link")

`[](#%5F%5Fcodelineno-5-1)import { ScreenOrientation, OrientationType } from '@capawesome/capacitor-screen-orientation';
[](#%5F%5Fcodelineno-5-2)
[](#%5F%5Fcodelineno-5-3)const lock = async () => {
[](#%5F%5Fcodelineno-5-4)  await ScreenOrientation.lock({ type: OrientationType.LANDSCAPE });
[](#%5F%5Fcodelineno-5-5)};
[](#%5F%5Fcodelineno-5-6)
[](#%5F%5Fcodelineno-5-7)const unlock = async () => {
[](#%5F%5Fcodelineno-5-8)  await ScreenOrientation.unlock();
[](#%5F%5Fcodelineno-5-9)};
[](#%5F%5Fcodelineno-5-10)
[](#%5F%5Fcodelineno-5-11)const getCurrentOrientation = async () => {
[](#%5F%5Fcodelineno-5-12)  const result = await ScreenOrientation.getCurrentOrientation();
[](#%5F%5Fcodelineno-5-13)  return result.type;
[](#%5F%5Fcodelineno-5-14)};
`

## API[¶](#api "Permanent link")

* [lock(...)](#lock)
* [unlock()](#unlock)
* [getCurrentOrientation()](#getcurrentorientation)
* [addListener('screenOrientationChange', ...)](#addlistenerscreenorientationchange-)
* [removeAllListeners()](#removealllisteners)
* [Interfaces](#interfaces)
* [Type Aliases](#type-aliases)
* [Enums](#enums)

### lock(...)[¶](#lock "Permanent link")

`[](#%5F%5Fcodelineno-6-1)lock(options?: LockOptions | undefined) => Promise<void>
`

Locks the device orientation.

| Param       | Type                        |
| ----------- | --------------------------- |
| **options** | [LockOptions](#lockoptions) |

---

### unlock()[¶](#unlock "Permanent link")

`[](#%5F%5Fcodelineno-7-1)unlock() => Promise<void>
`

Unlocks the device orientation.

---

### getCurrentOrientation()[¶](#getcurrentorientation "Permanent link")

`[](#%5F%5Fcodelineno-8-1)getCurrentOrientation() => Promise<GetCurrentOrientationResult>
`

Gets the current device orientation type.

**Returns:** `Promise<[GetCurrentOrientationResult](#getcurrentorientationresult)>`

---

### addListener('screenOrientationChange', ...)[¶](#addlistenerscreenorientationchange "Permanent link")

`[](#%5F%5Fcodelineno-9-1)addListener(eventName: 'screenOrientationChange', listenerFunc: ScreenOrientationChangeListener) => Promise<PluginListenerHandle>
`

Listen for screen orientation changes.

| Param            | Type                                                                |
| ---------------- | ------------------------------------------------------------------- |
| **eventName**    | 'screenOrientationChange'                                           |
| **listenerFunc** | [ScreenOrientationChangeListener](#screenorientationchangelistener) |

**Returns:** `Promise<[PluginListenerHandle](#pluginlistenerhandle)>`

---

### removeAllListeners()[¶](#removealllisteners "Permanent link")

`[](#%5F%5Fcodelineno-10-1)removeAllListeners() => Promise<void>
`

Remove all listeners for this plugin.

---

### Interfaces[¶](#interfaces "Permanent link")

#### LockOptions[¶](#lockoptions "Permanent link")

| Prop     | Type                                | Description                |
| -------- | ----------------------------------- | -------------------------- |
| **type** | [OrientationType](#orientationtype) | The orientation lock type. |

#### GetCurrentOrientationResult[¶](#getcurrentorientationresult "Permanent link")

| Prop     | Type                                | Description                   |
| -------- | ----------------------------------- | ----------------------------- |
| **type** | [OrientationType](#orientationtype) | The current orientation type. |

#### PluginListenerHandle[¶](#pluginlistenerhandle "Permanent link")

| Prop       | Type                |
| ---------- | ------------------- |
| **remove** | () => Promise<void> |

#### ScreenOrientationChange[¶](#screenorientationchange "Permanent link")

| Prop     | Type                                | Description                   |
| -------- | ----------------------------------- | ----------------------------- |
| **type** | [OrientationType](#orientationtype) | The current orientation type. |

### Type Aliases[¶](#type-aliases "Permanent link")

#### ScreenOrientationChangeListener[¶](#screenorientationchangelistener "Permanent link")

Callback to receive the screen orientation change notifications.

`(change: [ScreenOrientationChange](#screenorientationchange)): void`

### Enums[¶](#enums "Permanent link")

#### OrientationType[¶](#orientationtype "Permanent link")

| Members                  | Value                 | Description                                                         |
| ------------------------ | --------------------- | ------------------------------------------------------------------- |
| **LANDSCAPE**            | 'landscape'           | The orientation is either landscape-primary or landscape-secondary. |
| **LANDSCAPE\_PRIMARY**   | 'landscape-primary'   | The orientation is in the primary landscape mode.                   |
| **LANDSCAPE\_SECONDARY** | 'landscape-secondary' | The orientation is in the secondary landscape mode.                 |
| **PORTRAIT**             | 'portrait'            | The orientation is either portrait-primary or portrait-secondary.   |
| **PORTRAIT\_PRIMARY**    | 'portrait-primary'    | The orientation is in the primary portrait mode.                    |
| **PORTRAIT\_SECONDARY**  | 'portrait-secondary'  | The orientation is in the secondary portrait mode.                  |

## Changelog[¶](#changelog "Permanent link")

See [CHANGELOG.md](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/screen-orientation/CHANGELOG.md).

## License[¶](#license "Permanent link")

See [LICENSE](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/screen-orientation/LICENSE).

## Credits[¶](#credits "Permanent link")

This plugin is based on the [Capacitor Screen Orientation](https://github.com/capawesome-team/capacitor-screen-orientation) plugin. Thanks to everyone who contributed to the project!

May 21, 2026 

 Back to top 