id: plugin-splashscreen title: Splashscreen tags:
- cordova
- capacitor
- ionic
- javascript
- typescript
- plugin
- mobile
- splashscreen
Splashscreen
This plugin displays and hides a splash screen while your web application is launching. Using its methods you can also show and hide the splash screen manually.
Installation
Cordova
cordova plugin add cordova-plugin-splashscreen
npm install @awesome-cordova-library/splashscreen
Capacitor / Ionic
npm install cordova-plugin-splashscreen
npm install @awesome-cordova-library/splashscreen
npx cap sync
Vanilla
Declaration
class SplashScreen {
static show(): void;
static hide(): void;
}
Usages
import SplashScreen from "@awesome-cordova-library/SplashScreen";
// Displays the splash screen.
SplashScreen.show();
// Dismiss the splash screen.
SplashScreen.hide();
React
Declaration
const useSplashScreen: () => {
show: () => void;
hide: () => void;
};
Usages
import { useEffect } from "react";
import useSplashScreen from "@awesome-cordova-library/splashscreen/lib/react";
function App() {
const { show, hide } = useSplashScreen();
useEffect(() => {
show();
setTimeout(() => {
hide();
}, 3000);
}, []);
return <div />;
}