Repolode
ionic-team

ionic-team/capacitor

Capacitor is a cross-platform runtime that lets web apps run natively on iOS, Android, and the Web from one codebase.

Open-source alternative to:Apache Cordova

Stars
16,923
Forks
1,293
Open issues
151
Last commit
5 hours ago

What is it?

Capacitor wraps existing web apps so they run natively on iOS, Android, and the web. It provides a cross-platform API and execution layer that lets web code call native SDKs, and a Plugin API for writing custom native plugins in Swift (iOS) or Kotlin/Java (Android).

It is designed to drop into an existing modern web app rather than requiring a new framework. Developers install the core and CLI packages, initialize the project, and add native platform projects as needed. Native projects are kept as source code in the repository, so they can be edited directly.

Capacitor also supports Progressive Web App deployment, so a single app can be shipped to the app stores and the mobile web. It is maintained by the Ionic team and is intended as a modern successor to Apache Cordova, with backward compatibility for most Cordova plugins.

Key features

  • 01Runs one web codebase natively on iOS, Android, and the Web.
  • 02Provides a cross-platform API for calling native SDKs from JavaScript.
  • 03Includes a Plugin API for writing native plugins in Swift, Kotlin, or Java.
  • 04Treats native projects as editable source rather than generated build artifacts.
  • 05Offers backward compatibility with most Cordova plugins.

Use cases

  • Shipping an existing web app to the App Store and Google Play.
  • Accessing native device features from a JavaScript front end.
  • Writing a reusable native plugin and publishing it as an npm package.
  • Deploying one app to both native app stores and the mobile web.

Quick start

  1. 1

    Install the core and CLI packages in an existing web app

    npm install @capacitor/core @capacitor/cli
  2. 2

    Initialize Capacitor in your app

    npx cap init
  3. 3

    Install the Android platform

    npm install @capacitor/android
  4. 4

    Add the Android native project

    npx cap add android

Things to know

  • Native iOS builds require a Mac with Xcode, and the README does not cover this setup.

Topics

FAQ

What is capacitor?
Capacitor is a cross-platform runtime that lets web apps run natively on iOS, Android, and the Web from one codebase. Capacitor wraps existing web apps so they run natively on iOS, Android, and the web. It provides a cross-platform API and execution layer that lets web code call native SDKs, and a Plugin API for writing custom native plugins in Swift (iOS) or Kotlin/Java (Android).
Is capacitor free to use? What license does it have?
capacitor is open source under the MIT license. Check the license terms before using it in commercial products.
Is capacitor still maintained?
Actively maintained. The last commit to capacitor was on Oct 21, 2026.
What can I use capacitor for?
Shipping an existing web app to the App Store and Google Play. Accessing native device features from a JavaScript front end. Writing a reusable native plugin and publishing it as an npm package. Deploying one app to both native app stores and the mobile web.
How do I install capacitor?
Install the core and CLI packages in an existing web app: npm install @capacitor/core @capacitor/cli Initialize Capacitor in your app: npx cap init Install the Android platform: npm install @capacitor/android Add the Android native project: npx cap add android
Where can I get capacitor?
The source code and installation instructions are on GitHub: https://github.com/ionic-team/capacitor

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects