New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ns-react-block-ui

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ns-react-block-ui

A react component for blocking UI.

latest
Source
npmnpm
Version
1.0.13
Version published
Weekly downloads
75
-11.76%
Maintainers
1
Weekly downloads
 
Created
Source

ns-react-block-ui

A react component for blocking UI.

Document

https://nutthawutkongsopa.github.io/ns-react-block-ui

Installation 🛠️

npm install ns-react-block-ui

Npm package total downloads

Basic Using ✅

import { BlockUI } from "ns-react-block-ui";
<BlockUI blocking={isBlocking}>
  ...
  <OtherComponent />
</BlockUI>

Global Blocking (Context) 🌟

index.js

import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.scss';
import App from './App';
import { BlockUIProvider } from 'ns-react-block-ui'

const root = ReactDOM.createRoot(
  document.getElementById('root') as HTMLElement
);
root.render(
  <React.StrictMode>
    <BlockUIProvider loader="default">
      <App />
    </BlockUIProvider>
  </React.StrictMode>
);

SomeComponent.js

import { useBlockUIContext } from 'ns-react-block-ui'

SomeComponent = () => {
  const { setBlockUI } = useBlockUIContext();
  const blockUI = () => {
    setBlockUI({ blocking: true });
  };

  return (
    <>
      <button onClick={() => blockUI()}>Block Screen</button>
    </>
  );
};

Properties 🍀

BlockUI Properties

{
    blocking?: boolean;
    message?: string | ReactNode;
    overlayStyle?: CSSProperties;
    loader?: "default" | ReactNode;
    style?: CSSProperties;
    className?: string;
    mode?: "contain" | "stretch" | "full-screen";
    cursor?: "inherit" | "wait" | "default" | "progress" | "not-allowed";
    hideScroll?: boolean;
}

BlockUI Context Data

{
    blocking?: boolean;
    message?: string;
    loader?: ReactNode;
}

Compatible Version ⚖️

VersionReact VersionNode Version
0.1.816.13.1>=14.0.0
0.1.1116.13.1>=14.0.0
0.2.416.13.1>=14.0.0
0.2.6>=16.13.1>=14.0.0
1.x.x>=16.13.1>=14.0.0

Keywords

React

FAQs

Package last updated on 12 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts