---
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/sdks/capacitor/screen-orientation.png
---

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

[ 🔐 Introducing the **Capacitor Vault** plugin — store secrets behind biometrics or a device passcode.](/blog/announcing-the-capacitor-vault-plugin/) 

* [  SDKs ](/docs/sdks/)
* [  Formbricks ](/docs/sdks/capacitor/formbricks/)
* [  Geocoder ](/docs/sdks/capacitor/geocoder/)
* [  Google Sign-In ](/docs/sdks/capacitor/google-sign-in/)
* [  Grafana Faro ](/docs/sdks/capacitor/grafana-faro/)
* [  libSQL ](/docs/sdks/capacitor/libsql/)
* [  Live Update ](/docs/sdks/capacitor/live-update/)
* [  Managed Configurations ](/docs/sdks/capacitor/managed-configurations/)
* [  Media Session ](/docs/sdks/capacitor/media-session/)
* [  ML Kit ](/docs/sdks/capacitor/mlkit/)
* [  Navigation Bar ](/docs/sdks/capacitor/navigation-bar/)
* [  NFC ](/docs/sdks/capacitor/nfc/)
* [  OAuth ](/docs/sdks/capacitor/oauth/)
* [  Pedometer ](/docs/sdks/capacitor/pedometer/)
* [  Photo Editor ](/docs/sdks/capacitor/photo-editor/)
* [  PostHog ](/docs/sdks/capacitor/posthog/)
* [  Printer ](/docs/sdks/capacitor/printer/)
* [  Purchases ](/docs/sdks/capacitor/purchases/)
* [  RealtimeKit ](/docs/sdks/capacitor/realtimekit/)
* Screen Orientation [  Screen Orientation ](/docs/sdks/capacitor/screen-orientation/)
* [  Configuration ](#configuration)
* [  Demo ](#demo)
* [  Usage ](#usage)
* [  API ](#api)
* [  Type Aliases ](#type-aliases)
* [  Enums ](#enums)
* [  Changelog ](#changelog)
* [  License ](#license)
* [  Credits ](#credits)
* [  Screenshot ](/docs/sdks/capacitor/screenshot/)
* [  Secure Preferences ](/docs/sdks/capacitor/secure-preferences/)
* [  Speech Recognition ](/docs/sdks/capacitor/speech-recognition/)
* [  Speech Synthesis ](/docs/sdks/capacitor/speech-synthesis/)
* [  Share Target ](/docs/sdks/capacitor/share-target/)
* [  Square Mobile Payments ](/docs/sdks/capacitor/square-mobile-payments/)
* [  SQLite ](/docs/sdks/capacitor/sqlite/)
* [  Superwall ](/docs/sdks/capacitor/superwall/)
* [  Torch ](/docs/sdks/capacitor/torch/)
* [  Vault ](/docs/sdks/capacitor/vault/)
* [  Wifi ](/docs/sdks/capacitor/wifi/)
* [  Zip ](/docs/sdks/capacitor/zip/)
* [  Cordova ](/docs/sdks/cordova/)
* [  Cloud ](/docs/cloud/)
* [  Integrations ](/docs/cloud/live-updates/integrations/)
* Concepts
* Reference
* [  Troubleshooting ](/docs/cloud/live-updates/troubleshooting/)
* [  FAQ ](/docs/cloud/live-updates/faq/)
* [  Native Builds ](/docs/cloud/native-builds/)
* [  Set Up Environments ](/docs/cloud/native-builds/environments/)
* [  Overwrite Native Configurations ](/docs/cloud/native-builds/native-configurations/)
* [  Auto-Increment Build Numbers ](/docs/cloud/native-builds/auto-incrementing-build-numbers/)
* [  Configure the Web Build Script ](/docs/cloud/native-builds/web-build-script/)
* [  Build from a Monorepo ](/docs/cloud/native-builds/monorepo/)
* [  Use pnpm or Yarn ](/docs/cloud/native-builds/package-managers/)
* [  Install Private npm Packages ](/docs/cloud/native-builds/npm-private-registry/)
* [  Override the Java Version ](/docs/cloud/native-builds/override-java-version/)
* [  Custom iOS Provisioning Profiles ](/docs/cloud/native-builds/custom-ios-provisioning-profiles/)
* [  Build without Git ](/docs/cloud/native-builds/build-without-git/)
* [  Access Git Behind a Firewall ](/docs/cloud/native-builds/firewall-access/)
* [  Integrations ](/docs/cloud/native-builds/integrations/)
* Reference
* [  Troubleshooting ](/docs/cloud/native-builds/troubleshooting/)
* [  FAQ ](/docs/cloud/native-builds/faq/)
* [  App Store Publishing ](/docs/cloud/app-store-publishing/)
* [  Submit a Build ](/docs/cloud/app-store-publishing/submit-a-build/)
* [  Submit Automatically After a Build ](/docs/cloud/app-store-publishing/submit-automatically/)
* [  Troubleshooting ](/docs/cloud/app-store-publishing/troubleshooting/)
* [  FAQ ](/docs/cloud/app-store-publishing/faq/)
* [  Automations ](/docs/cloud/automations/)
* [  Reference ](/docs/cloud/automations/reference/)
* [  Troubleshooting ](/docs/cloud/automations/troubleshooting/)
* [  FAQ ](/docs/cloud/automations/faq/)
* [  Assist ](/docs/cloud/assist/)
* [  CLI ](/docs/cloud/cli/)
* APIs and SDKs
* [  Webhooks ](/docs/cloud/webhooks/)
* [  Integrations ](/docs/cloud/integrations/)
* Account
* [  Organization ](/docs/cloud/organizations/)
* [  Two-Factor Enforcement ](/docs/cloud/organizations/two-factor-authentication/)
* [  Audit Logs ](/docs/cloud/organizations/audit-logs/)
* [  Billing ](/docs/cloud/organizations/billing/)
* [  License Keys ](/docs/cloud/license-keys/)
* [  AI ](/docs/ai/)
* [  Insiders ](/docs/insiders/)
* [  Billing & Plans ](/docs/insiders/billing-and-plans/)
* [  FAQ ](/docs/insiders/faq/)
* [  License ](https://capawesome.io/legal/eula/)
* [  Support ](/docs/support/)
* [  Contributing ](/docs/contributing/)
* Contributing code
* [  Code of Conduct ](/docs/contributing/code-of-conduct/)
* [  Questions ](https://docs.github.com/en/discussions/collaborating-with-your-community-using-discussions/participating-in-a-discussion#creating-a-discussion)
* [  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 