1.0.1 • Published 8 months ago

@awesome-cordova-library/splashscreen v1.0.1

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
github
Last release
8 months ago

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.

Online documentation

Cordova documentation

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 />;
}