Capacitor plugin for taking screenshots.
npm install @capawesome/capacitor-screenshotCapacitor plugin for taking screenshots.
We are proud to offer one of the most complete and feature-rich Capacitor plugins for capturing screenshots. Here are some of the key features:
- 🖥️ Cross-platform: Supports Android, iOS, and Web.
- 📸 Easy screenshots: Simple one-method API for taking screenshots.
- 🌐 Web support: Uses html2canvas for web platform screenshot capture.
- 📱 Native capture: High-quality native screenshot capture on mobile.
- 🔁 Up-to-date: Always supports the latest Capacitor version.
Missing a feature? Just open an issue and we'll take a look!
Stay up to date with the latest news and updates about the Capawesome, Capacitor, and Ionic ecosystem by subscribing to our Capawesome Newsletter.
| Plugin Version | Capacitor Version | Status |
| -------------- | ----------------- | -------------- |
| 8.x.x | >=8.x.x | Active support |
Install the plugin:
``bash`
npm install @capawesome/capacitor-screenshot
npx cap sync
If you are using the Web platform, you must also install the html2canvas package:
`bash`
npm i html2canvas
`ts
import { Screenshot } from '@capawesome/capacitor-screenshot';
const take = async () => {
const { uri } = await Screenshot.take();
console.log('Screenshot saved at:', uri);
};
`
* take()
* Interfaces
`typescript`
take() => Promise
Take a screenshot.
Returns: Promise<TakeResult>
Since: 6.0.0
--------------------
#### TakeResult
| Prop | Type | Description | Since |
| --------- | ------------------- | -------------------------------------------------------------------- | ----- |
| uri` | string | The file path (Android and iOS) or data URI (Web) of the screenshot. | 6.0.0 |
See CHANGELOG.md.
See LICENSE.