Description #
Capacitor is a cross-platform native runtime for building web apps that run natively on iOS, Android, and desktop using modern web technologies.
History #
Created by the Ionic team in 2018, Capacitor was introduced as a spiritual successor to Cordova, offering modern APIs and better integration with native functionality.
Hello World Code #
import { Toast } from '@capacitor/toast';
Toast.show({ text: 'Hello, World!' });
How to Run #
Option 1: Online
StackBlitz Ionic + Capacitor Starter
Option 2: Local
Install via npm:
npm install @capacitor/core @capacitor/cli
npx cap init
Key Concepts #
- Native API bridging
- Progressive Web App support
- Offline-first mobile apps
- Plugin ecosystem
- Works with any front-end (React, Vue, etc.)
- CLI tools for iOS/Android builds
- Live reload via dev server
- Access to camera, GPS, filesystem
- Easy deployment to app stores
- Backed by Ionic ecosystem
Try It Online #
Fun Facts #
Capacitor apps can run in browsers, desktop apps (via Electron), and mobile devices—often from a single codebase.