npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@awesome-cordova-library/statusbar

v1.0.1

Published

The StatusBar object provides some functions to customize the iOS and Android StatusBar.

Downloads

9

Readme


id: plugin-statusbar title: Statusbar tags:

  • cordova
  • capacitor
  • ionic
  • javascript
  • typescript
  • plugin
  • mobile
  • statusbar

Statusbar

The StatusBar object provides some functions to customize the iOS and Android StatusBar.

Online documentation

Cordova documentation

Installation

Cordova

cordova plugin add cordova-plugin-statusbar
npm install @awesome-cordova-library/statusbar

Capacitor / Ionic

npm install cordova-plugin-statusbar
npm install @awesome-cordova-library/statusbar
npx cap sync

Vanilla

Declaration

class Statusbar {
  static overlaysWebView(isOverlay: boolean): void;
  static styleDefault(): void;
  static styleLightContent(): void;
  static styleBlackTranslucent(): void;
  static styleBlackOpaque(): void;
  static backgroundColorByName(color: string): void;
  static backgroundColorByHexString(color: string): void;
  static show(): void;
  static hide(): void;
  static isVisible(): boolean;
  static warnPluginIsUnInstallOrIncompatible(): void;
  static changeThemeColor(color: string): void;
}

Usages

import Statusbar from '@awesome-cordova-library/statusbar';

/**
 * On iOS 7, make the statusbar overlay or not overlay the WebView.
 *
 * @param isOverlay - On iOS 7, set to false to make the statusbar appear like iOS 6.
 *                    Set the style and background color to suit using the other functions.
 */
Statusbar.overlaysWebView(true);
/**
 * Use the default statusbar (dark text, for light backgrounds).
 */
Statusbar.styleDefault();
/**
 * Use the lightContent statusbar (light text, for dark backgrounds).
 */
Statusbar.styleLightContent();
/**
 * Use the blackTranslucent statusbar (light text, for dark backgrounds).
 */
Statusbar.styleBlackTranslucent();
/**
 * Use the blackOpaque statusbar (light text, for dark backgrounds).
 */
Statusbar.styleBlackOpaque();
/**
   * On iOS 7, when you set StatusBar.statusBarOverlaysWebView to false,
   * you can set the background color of the statusbar by color name.
   *
   * @param color - Supported color names are:
   *                black, darkGray, lightGray, white, gray, red, green, blue, cyan, yellow, magenta, orange, purple, brown
*/
Statusbar.backgroundColorByName(color: string);
/**
   * Sets the background color of the statusbar by a hex string.
   *
   * @param color - CSS shorthand properties are also supported.
   *                On iOS 7, when you set StatusBar.statusBarOverlaysWebView to false, you can set the background color of the statusbar by a hex string (#RRGGBB).
   *                On WP7 and WP8 you can also specify values as #AARRGGBB, where AA is an alpha value
*/
Statusbar.backgroundColorByHexString(color: string);
/**
 * Shows the statusbar.
*/
Statusbar.show();
/**
 * Hide the statusbar.
*/
Statusbar.hide();
/**
 * Read this property to see if the statusbar is visible or not.
 */
Statusbar.isVisible();
/**
 * Sets color of meta balise theme-color
*/
Statusbar.changeThemeColor(color: string);

React

Declaration

const useStatusbar: () => {
  overlaysWebView: (isOverlay: boolean) => void;
  styleDefault: () => void;
  styleLightContent: () => void;
  styleBlackTranslucent: () => void;
  styleBlackOpaque: () => void;
  backgroundColorByName: (color: string) => void;
  backgroundColorByHexString: (color: string) => void;
  hide: () => void;
  show: () => void;
  isVisible: () => boolean;
};

Usages

import { useEffect } from "react";
import useStatusbar from "@awesome-cordova-library/statusbar/lib/react";

function App() {
  const {
    overlaysWebView,
    styleDefault,
    styleLightContent,
    styleBlackTranslucent,
    styleBlackOpaque,
    backgroundColorByName,
    backgroundColorByHexString,
    hide,
    show,
    isVisible,
  } = useStatusbar();

  useEffect(() => {
    styleDefault();
    overlaysWebView(false);
    backgroundColorByHexString("#FFA500");
  }, []);

  return <div />;
}